Browse Source

Add a couple of small but vital parts to PXENV_UDP_WRITE.

tags/v0.9.3
Michael Brown 18 years ago
parent
commit
691557281f
1 changed files with 12 additions and 1 deletions
  1. 12
    1
      src/interface/pxe/pxe_udp.c

+ 12
- 1
src/interface/pxe/pxe_udp.c View File

285
 		struct sockaddr_in sin;
285
 		struct sockaddr_in sin;
286
 		struct sockaddr_tcpip st;
286
 		struct sockaddr_tcpip st;
287
 	} dest;
287
 	} dest;
288
+	int rc;
288
 
289
 
289
 	DBG ( "PXENV_UDP_WRITE" );
290
 	DBG ( "PXENV_UDP_WRITE" );
290
 
291
 
299
 	dest.sin.sin_family = AF_INET;
300
 	dest.sin.sin_family = AF_INET;
300
 	dest.sin.sin_addr.s_addr = pxenv_udp_write->ip;
301
 	dest.sin.sin_addr.s_addr = pxenv_udp_write->ip;
301
 	dest.sin.sin_port = pxenv_udp_write->dst_port;
302
 	dest.sin.sin_port = pxenv_udp_write->dst_port;
303
+	udp_connect ( &pxe_udp.udp, &dest.st );
302
 
304
 
303
 	/* Set local (source) port.  PXE spec says source port is 2069
305
 	/* Set local (source) port.  PXE spec says source port is 2069
304
 	 * if not specified.  Really, this ought to be set at UDP open
306
 	 * if not specified.  Really, this ought to be set at UDP open
312
 	 * confident of being able to do our own routing.  We should
314
 	 * confident of being able to do our own routing.  We should
313
 	 * probably allow for multiple gateways.
315
 	 * probably allow for multiple gateways.
314
 	 */
316
 	 */
317
+
318
+	DBG ( " %04x:%04x+%x %d->%s:%d", pxenv_udp_write->buffer.segment,
319
+	      pxenv_udp_write->buffer.offset, pxenv_udp_write->buffer_size,
320
+	      ntohs ( pxenv_udp_write->src_port ),
321
+	      inet_ntoa ( dest.sin.sin_addr ),
322
+	      ntohs ( pxenv_udp_write->dst_port ) );
315
 	
323
 	
316
 	/* Transmit packet */
324
 	/* Transmit packet */
317
-	if ( udp_senddata ( &pxe_udp.udp ) != 0 ) {
325
+	pxe_udp.pxenv_udp_write = pxenv_udp_write;
326
+	rc = udp_senddata ( &pxe_udp.udp );
327
+	pxe_udp.pxenv_udp_write = NULL;
328
+	if ( rc != 0 ) {
318
 		pxenv_udp_write->Status = PXENV_STATUS_UNDI_TRANSMIT_ERROR;
329
 		pxenv_udp_write->Status = PXENV_STATUS_UNDI_TRANSMIT_ERROR;
319
 		return PXENV_EXIT_FAILURE;
330
 		return PXENV_EXIT_FAILURE;
320
 	}
331
 	}

Loading…
Cancel
Save