summaryrefslogtreecommitdiffstats
path: root/src/net/netdevice.c
diff options
context:
space:
mode:
authorMichael Brown2011-07-15 19:48:46 +0200
committerMichael Brown2011-07-15 19:48:46 +0200
commita667bf044a37f9e96830f1f35627829860f7019f (patch)
treefabf3420f244fd35ed3576169db8cf0cd706dd9f /src/net/netdevice.c
parent[http] Include port in HTTP Host header as needed (diff)
downloadipxe-a667bf044a37f9e96830f1f35627829860f7019f.tar.gz
ipxe-a667bf044a37f9e96830f1f35627829860f7019f.tar.xz
ipxe-a667bf044a37f9e96830f1f35627829860f7019f.zip
[netdevice] Allow link layer to report broadcast/multicast packets via pull()
Allow the link layer to directly report whether or not a packet is multicast or broadcast at the time of calling pull(), rather than relying on heuristics to determine this at a later stage. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/net/netdevice.c')
-rw-r--r--src/net/netdevice.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/net/netdevice.c b/src/net/netdevice.c
index 52ad8292..f5ec4191 100644
--- a/src/net/netdevice.c
+++ b/src/net/netdevice.c
@@ -678,17 +678,19 @@ int net_tx ( struct io_buffer *iobuf, struct net_device *netdev,
* @v net_proto Network-layer protocol, in network-byte order
* @v ll_dest Destination link-layer address
* @v ll_source Source link-layer address
+ * @v flags Packet flags
* @ret rc Return status code
*/
int net_rx ( struct io_buffer *iobuf, struct net_device *netdev,
- uint16_t net_proto, const void *ll_dest, const void *ll_source ) {
+ uint16_t net_proto, const void *ll_dest, const void *ll_source,
+ unsigned int flags ) {
struct net_protocol *net_protocol;
/* Hand off to network-layer protocol, if any */
for_each_table_entry ( net_protocol, NET_PROTOCOLS ) {
if ( net_protocol->net_proto == net_proto )
return net_protocol->rx ( iobuf, netdev, ll_dest,
- ll_source );
+ ll_source, flags );
}
DBGC ( netdev, "NETDEV %s unknown network protocol %04x\n",
@@ -710,6 +712,7 @@ void net_poll ( void ) {
const void *ll_dest;
const void *ll_source;
uint16_t net_proto;
+ unsigned int flags;
int rc;
/* Poll and process each network device */
@@ -743,7 +746,8 @@ void net_poll ( void ) {
ll_protocol = netdev->ll_protocol;
if ( ( rc = ll_protocol->pull ( netdev, iobuf,
&ll_dest, &ll_source,
- &net_proto ) ) != 0 ) {
+ &net_proto,
+ &flags ) ) != 0 ) {
free_iob ( iobuf );
continue;
}
@@ -751,7 +755,7 @@ void net_poll ( void ) {
/* Hand packet to network layer */
if ( ( rc = net_rx ( iob_disown ( iobuf ), netdev,
net_proto, ll_dest,
- ll_source ) ) != 0 ) {
+ ll_source, flags ) ) != 0 ) {
/* Record error for diagnosis */
netdev_rx_err ( netdev, NULL, rc );
}