summaryrefslogtreecommitdiffstats
path: root/src/net/udp.c
diff options
context:
space:
mode:
authorMichael Brown2006-08-04 01:10:14 +0200
committerMichael Brown2006-08-04 01:10:14 +0200
commitffe0e24249d1dbec59f7b2454974a5855043ba95 (patch)
tree891adef4bdc493cc66e2430b600aa8edf1ef1deb /src/net/udp.c
parentUpdated PXE UDP implementation to use the new Etherboot UDP API. (diff)
downloadipxe-ffe0e24249d1dbec59f7b2454974a5855043ba95.tar.gz
ipxe-ffe0e24249d1dbec59f7b2454974a5855043ba95.tar.xz
ipxe-ffe0e24249d1dbec59f7b2454974a5855043ba95.zip
Make the UDP senddata() methods return a status code.
udp_connect() now follows the standard BSD sockets semantics and simply sets the default address for outgoing packets; it doesn't filter incoming packets.
Diffstat (limited to 'src/net/udp.c')
-rw-r--r--src/net/udp.c25
1 files changed, 2 insertions, 23 deletions
diff --git a/src/net/udp.c b/src/net/udp.c
index 9f55c94f..5c2188fa 100644
--- a/src/net/udp.c
+++ b/src/net/udp.c
@@ -67,18 +67,6 @@ void udp_connect ( struct udp_connection *conn, struct sockaddr_tcpip *peer ) {
}
/**
- * Connect UDP connection to all remote hosts and ports
- *
- * @v conn UDP connection
- *
- * This undoes the effect of a call to udp_connect(), i.e. allows the
- * connection to receive packets from all remote hosts and ports.
- */
-void udp_connect_promisc ( struct udp_connection *conn ) {
- memset ( &conn->peer, 0, sizeof ( conn->peer ) );
-}
-
-/**
* Open a local port
*
* @v conn UDP connection
@@ -140,9 +128,8 @@ int udp_senddata ( struct udp_connection *conn ) {
return -ENOMEM;
}
pkb_reserve ( conn->tx_pkb, UDP_MAX_HLEN );
- conn->udp_op->senddata ( conn, conn->tx_pkb->data,
- pkb_available ( conn->tx_pkb ) );
- return 0;
+ return conn->udp_op->senddata ( conn, conn->tx_pkb->data,
+ pkb_available ( conn->tx_pkb ) );
}
/**
@@ -271,14 +258,6 @@ static int udp_rx ( struct pk_buff *pkb, struct sockaddr_tcpip *st_src,
/* Bound to local port and local port doesn't match */
continue;
}
- if ( conn->peer.st_family &&
- ( memcmp ( &conn->peer, st_src,
- sizeof ( conn->peer ) ) != 0 ) ) {
- /* Connected to remote port and remote port
- * doesn't match
- */
- continue;
- }
/* Strip off the UDP header */
pkb_pull ( pkb, sizeof ( *udphdr ) );