summaryrefslogtreecommitdiffstats
path: root/src/net/udp.c
diff options
context:
space:
mode:
authorMichael Brown2007-11-28 12:56:14 +0100
committerMichael Brown2007-11-28 12:56:14 +0100
commit423e9d72f33bcf7f3613ac90993dd6e133a61451 (patch)
tree8517bcb0b6f3339fe3d4b55e6ae2c001799f2ff4 /src/net/udp.c
parentAdd RFC2090 TFTP multicast support. (diff)
downloadipxe-423e9d72f33bcf7f3613ac90993dd6e133a61451.tar.gz
ipxe-423e9d72f33bcf7f3613ac90993dd6e133a61451.tar.xz
ipxe-423e9d72f33bcf7f3613ac90993dd6e133a61451.zip
udp_open_promisc() calls udp_open_common() with peer==NULL.
Diffstat (limited to 'src/net/udp.c')
-rw-r--r--src/net/udp.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/net/udp.c b/src/net/udp.c
index b4cd8e6b..fcd5732d 100644
--- a/src/net/udp.c
+++ b/src/net/udp.c
@@ -89,7 +89,7 @@ static int udp_bind ( struct udp_connection *udp, unsigned int port ) {
* Open a UDP connection
*
* @v xfer Data transfer interface
- * @v peer Peer socket address
+ * @v peer Peer socket address, or NULL
* @v local Local socket address, or NULL
* @v promisc Socket is promiscuous
* @ret rc Return status code
@@ -109,7 +109,8 @@ static int udp_open_common ( struct xfer_interface *xfer,
return -ENOMEM;
DBGC ( udp, "UDP %p allocated\n", udp );
xfer_init ( &udp->xfer, &udp_xfer_operations, &udp->refcnt );
- memcpy ( &udp->peer, st_peer, sizeof ( udp->peer ) );
+ if ( st_peer )
+ memcpy ( &udp->peer, st_peer, sizeof ( udp->peer ) );
/* Bind to local port */
if ( ! promisc ) {