summaryrefslogtreecommitdiffstats
path: root/src/drivers
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/drivers
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/drivers')
-rw-r--r--src/drivers/net/ipoib.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/drivers/net/ipoib.c b/src/drivers/net/ipoib.c
index 4917b58e..bc71a456 100644
--- a/src/drivers/net/ipoib.c
+++ b/src/drivers/net/ipoib.c
@@ -224,11 +224,13 @@ static int ipoib_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 ipoib_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 ) {
struct ipoib_device *ipoib = netdev->priv;
struct ipoib_hdr *ipoib_hdr = iobuf->data;
struct ipoib_peer *dest;
@@ -255,6 +257,7 @@ static int ipoib_pull ( struct net_device *netdev,
*ll_dest = ( dest ? &dest->mac : &ipoib->broadcast );
*ll_source = ( source ? &source->mac : &ipoib->broadcast );
*net_proto = ipoib_hdr->proto;
+ *flags = ( ( *ll_dest == &ipoib->broadcast ) ? LL_BROADCAST : 0 );
return 0;
}