diff options
author | Michael Brown <mcb30@ipxe.org> | 2011-07-15 18:48:46 +0100 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2011-07-15 18:48:46 +0100 |
commit | a667bf044a37f9e96830f1f35627829860f7019f (patch) | |
tree | fabf3420f244fd35ed3576169db8cf0cd706dd9f /src/net/ethernet.c | |
parent | 69b7d57265679d76e26581d034e8f8ab5168bb27 (diff) | |
download | ipxe-a667bf044a37f9e96830f1f35627829860f7019f.tar.gz |
[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/ethernet.c')
-rw-r--r-- | src/net/ethernet.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/net/ethernet.c b/src/net/ethernet.c index d14cfefcc..c63fd9bc3 100644 --- a/src/net/ethernet.c +++ b/src/net/ethernet.c @@ -71,11 +71,13 @@ static int eth_push ( struct net_device *netdev __unused, * @ret ll_dest Link-layer destination address * @ret ll_source Source link-layer address * @ret net_proto Network-layer protocol, in network-byte order + * @ret flags Packet flags * @ret rc Return status code */ static int eth_pull ( struct net_device *netdev __unused, struct io_buffer *iobuf, const void **ll_dest, - const void **ll_source, uint16_t *net_proto ) { + const void **ll_source, uint16_t *net_proto, + unsigned int *flags ) { struct ethhdr *ethhdr = iobuf->data; /* Sanity check */ @@ -92,6 +94,10 @@ static int eth_pull ( struct net_device *netdev __unused, *ll_dest = ethhdr->h_dest; *ll_source = ethhdr->h_source; *net_proto = ethhdr->h_protocol; + *flags = ( ( is_multicast_ether_addr ( ethhdr->h_dest ) ? + LL_MULTICAST : 0 ) | + ( is_broadcast_ether_addr ( ethhdr->h_dest ) ? + LL_BROADCAST : 0 ) ); return 0; } |