aboutsummaryrefslogtreecommitdiff
path: root/src/interface
diff options
context:
space:
mode:
authorMichael Brown <mcb30@etherboot.org>2006-08-09 01:57:02 +0000
committerMichael Brown <mcb30@etherboot.org>2006-08-09 01:57:02 +0000
commit691557281f6dfa5d5e614dc3e9cd69823839ae12 (patch)
tree3b7e4ab21f8eafcf2ef82ab6db54c2673a2e616e /src/interface
parenta3d508b648906fb742e5205bcd4b97fbf88ea653 (diff)
downloadipxe-691557281f6dfa5d5e614dc3e9cd69823839ae12.zip
ipxe-691557281f6dfa5d5e614dc3e9cd69823839ae12.tar.gz
ipxe-691557281f6dfa5d5e614dc3e9cd69823839ae12.tar.bz2
Add a couple of small but vital parts to PXENV_UDP_WRITE.
Diffstat (limited to 'src/interface')
-rw-r--r--src/interface/pxe/pxe_udp.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/interface/pxe/pxe_udp.c b/src/interface/pxe/pxe_udp.c
index 8dced9e..5f94e8c 100644
--- a/src/interface/pxe/pxe_udp.c
+++ b/src/interface/pxe/pxe_udp.c
@@ -285,6 +285,7 @@ PXENV_EXIT_t pxenv_udp_write ( struct s_PXENV_UDP_WRITE *pxenv_udp_write ) {
struct sockaddr_in sin;
struct sockaddr_tcpip st;
} dest;
+ int rc;
DBG ( "PXENV_UDP_WRITE" );
@@ -299,6 +300,7 @@ PXENV_EXIT_t pxenv_udp_write ( struct s_PXENV_UDP_WRITE *pxenv_udp_write ) {
dest.sin.sin_family = AF_INET;
dest.sin.sin_addr.s_addr = pxenv_udp_write->ip;
dest.sin.sin_port = pxenv_udp_write->dst_port;
+ udp_connect ( &pxe_udp.udp, &dest.st );
/* Set local (source) port. PXE spec says source port is 2069
* if not specified. Really, this ought to be set at UDP open
@@ -312,9 +314,18 @@ PXENV_EXIT_t pxenv_udp_write ( struct s_PXENV_UDP_WRITE *pxenv_udp_write ) {
* confident of being able to do our own routing. We should
* probably allow for multiple gateways.
*/
+
+ DBG ( " %04x:%04x+%x %d->%s:%d", pxenv_udp_write->buffer.segment,
+ pxenv_udp_write->buffer.offset, pxenv_udp_write->buffer_size,
+ ntohs ( pxenv_udp_write->src_port ),
+ inet_ntoa ( dest.sin.sin_addr ),
+ ntohs ( pxenv_udp_write->dst_port ) );
/* Transmit packet */
- if ( udp_senddata ( &pxe_udp.udp ) != 0 ) {
+ pxe_udp.pxenv_udp_write = pxenv_udp_write;
+ rc = udp_senddata ( &pxe_udp.udp );
+ pxe_udp.pxenv_udp_write = NULL;
+ if ( rc != 0 ) {
pxenv_udp_write->Status = PXENV_STATUS_UNDI_TRANSMIT_ERROR;
return PXENV_EXIT_FAILURE;
}