2
0
mirror of https://github.com/xcat2/xNBA.git synced 2024-11-25 19:08:35 +00:00

udp_open_promisc() calls udp_open_common() with peer==NULL.

This commit is contained in:
Michael Brown 2007-11-28 11:56:14 +00:00
parent 3b1efba864
commit 423e9d72f3

View File

@ -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 ) {