|
@@ -89,7 +89,7 @@ static int udp_bind ( struct udp_connection *udp, unsigned int port ) {
|
89
|
89
|
* Open a UDP connection
|
90
|
90
|
*
|
91
|
91
|
* @v xfer Data transfer interface
|
92
|
|
- * @v peer Peer socket address
|
|
92
|
+ * @v peer Peer socket address, or NULL
|
93
|
93
|
* @v local Local socket address, or NULL
|
94
|
94
|
* @v promisc Socket is promiscuous
|
95
|
95
|
* @ret rc Return status code
|
|
@@ -109,7 +109,8 @@ static int udp_open_common ( struct xfer_interface *xfer,
|
109
|
109
|
return -ENOMEM;
|
110
|
110
|
DBGC ( udp, "UDP %p allocated\n", udp );
|
111
|
111
|
xfer_init ( &udp->xfer, &udp_xfer_operations, &udp->refcnt );
|
112
|
|
- memcpy ( &udp->peer, st_peer, sizeof ( udp->peer ) );
|
|
112
|
+ if ( st_peer )
|
|
113
|
+ memcpy ( &udp->peer, st_peer, sizeof ( udp->peer ) );
|
113
|
114
|
|
114
|
115
|
/* Bind to local port */
|
115
|
116
|
if ( ! promisc ) {
|