Browse Source

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

tags/v0.9.3
Michael Brown 17 years ago
parent
commit
423e9d72f3
1 changed files with 3 additions and 2 deletions
  1. 3
    2
      src/net/udp.c

+ 3
- 2
src/net/udp.c View File

89
  * Open a UDP connection
89
  * Open a UDP connection
90
  *
90
  *
91
  * @v xfer		Data transfer interface
91
  * @v xfer		Data transfer interface
92
- * @v peer		Peer socket address
92
+ * @v peer		Peer socket address, or NULL
93
  * @v local		Local socket address, or NULL
93
  * @v local		Local socket address, or NULL
94
  * @v promisc		Socket is promiscuous
94
  * @v promisc		Socket is promiscuous
95
  * @ret rc		Return status code
95
  * @ret rc		Return status code
109
 		return -ENOMEM;
109
 		return -ENOMEM;
110
 	DBGC ( udp, "UDP %p allocated\n", udp );
110
 	DBGC ( udp, "UDP %p allocated\n", udp );
111
 	xfer_init ( &udp->xfer, &udp_xfer_operations, &udp->refcnt );
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
 	/* Bind to local port */
115
 	/* Bind to local port */
115
 	if ( ! promisc ) {
116
 	if ( ! promisc ) {

Loading…
Cancel
Save