summaryrefslogtreecommitdiffstats
path: root/src/net/80211
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/80211
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/80211')
-rw-r--r--src/net/80211/net80211.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/net/80211/net80211.c b/src/net/80211/net80211.c
index 466d1243..c00363cd 100644
--- a/src/net/80211/net80211.c
+++ b/src/net/80211/net80211.c
@@ -135,7 +135,8 @@ static int net80211_ll_push ( struct net_device *netdev,
const void *ll_source, uint16_t net_proto );
static int net80211_ll_pull ( struct net_device *netdev,
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 );
/** @} */
/**
@@ -529,6 +530,7 @@ static int net80211_ll_push ( struct net_device *netdev,
* @ret ll_dest Link-layer destination address
* @ret ll_source Link-layer source
* @ret net_proto Network-layer protocol, in network byte order
+ * @ret flags Packet flags
* @ret rc Return status code
*
* This expects and removes both the 802.11 frame header and the 802.2
@@ -537,7 +539,7 @@ static int net80211_ll_push ( struct net_device *netdev,
static int net80211_ll_pull ( struct net_device *netdev __unused,
struct io_buffer *iobuf,
const void **ll_dest, const void **ll_source,
- uint16_t * net_proto )
+ uint16_t * net_proto, unsigned int *flags )
{
struct ieee80211_frame *hdr = iobuf->data;
struct ieee80211_llc_snap_header *lhdr =
@@ -586,6 +588,10 @@ static int net80211_ll_pull ( struct net_device *netdev __unused,
*ll_dest = hdr->addr1;
*ll_source = hdr->addr3;
*net_proto = lhdr->ethertype;
+ *flags = ( ( is_multicast_ether_addr ( hdr->addr1 ) ?
+ LL_MULTICAST : 0 ) |
+ ( is_broadcast_ether_addr ( hdr->addr1 ) ?
+ LL_BROADCAST : 0 ) );
return 0;
}