: Allow multicast traffic to be caught by ORIGDEV when bonded
Subsystems (3)
PATCH 1/1 : Allow multicast traffic to be caught by ORIGDEV when bonded
The socket option for packet sockets to return the original ifindex instead of the bonded ifindex will not match multicast traffic. Since this socket option is the most useful for layer 2 traffic and multicast traffic, make the option multicast-aware.
---
net/packet/af_packet.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
net/packet/af_packet.c +2 -2
@@ -515,7 +515,7 @@ static int packet_rcv(struct sk_buff *skb, struct net_device *dev, struct packet sll->sll_hatype = dev->type; sll->sll_protocol = skb->protocol; sll->sll_pkttype = skb->pkt_type; -if (unlikely (po->origdev) && skb->pkt_type ==PACKET_HOST ) +if (unlikely (po->origdev)) sll->sll_ifindex = orig_dev->ifindex;else sll->sll_ifindex = dev->ifindex;
@@ -661,7 +661,7 @@ static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev, struct packe sll->sll_hatype = dev->type; sll->sll_protocol = skb->protocol; sll->sll_pkttype = skb->pkt_type; -if (unlikely (po->origdev) && skb->pkt_type ==PACKET_HOST ) +if (unlikely (po->origdev)) sll->sll_ifindex = orig_dev->ifindex;else sll->sll_ifindex = dev->ifindex;
David Miller
maintainerFrom: PJ Waskiewicz <[email protected]>
Date: Tue, 06 Nov 2007 07:25:47 -0800
Quoted 6 lines
The socket option for packet sockets to return the original ifindex instead of the bonded ifindex will not match multicast traffic. Since this socket option is the most useful for layer 2 traffic and multicast traffic, make the option multicast-aware.
Signed-off-by Peter P Waskiewicz Jr <[email protected]>
I agree with you in principle, but I'd like to hear some feedback from other folks. In particular I'd like a discussion about what this might break, if anything.
Quoted 6 lines
Quoted 2 lines
The socket option for packet sockets to return the original ifindex instead of the bonded ifindex will not match multicast
traffic. Since
Quoted 3 lines
this socket option is the most useful for layer 2 traffic and multicast traffic, make the option multicast-aware.
Quoted 6 lines
Quoted 1 line
Signed-off-by Peter P Waskiewicz JrI agree with you in principle, but I'd like to hear some feedback from other folks. In particular I'd like a discussion about what this might break, if anything.
That's reasonable. In any event, the only thing this could affect is if the option is set on the socket, which shouldn't be very often at all.
I'm more than open to feedback on this change.
Thanks Dave,
-PJ Waskiewicz
David Miller
maintainerFrom: "Waskiewicz Jr, Peter P" <[email protected]>
Date: Wed, 7 Nov 2007 03:00:42 -0800
Quoted 2 lines
In any event, the only thing this could affect is if the option is set on the socket, which shouldn't be very often at all.
Any idea how many programs set this option and which ones? You obviously noticed, so perhaps you know at least one or was this discovered purely by code inspection?
Quoted 11 lines
-----Original Message-----
From: David Miller [mailto:[email protected]]
Sent: Wednesday, November 07, 2007 3:52 AM
To: Waskiewicz Jr, Peter P
Cc: [email protected]
Subject: Re: [PATCH] [AF_PACKET]: Allow multicast traffic to be caught by ORIGDEV when bondedFrom: "Waskiewicz Jr, Peter P" <[email protected]>
Date: Wed, 7 Nov 2007 03:00:42 -0800
Quoted 7 lines
Quoted 1 line
In any event, the only thing this could affect is if the
option is set
Quoted 1 line
on the socket, which shouldn't be very often at all.
Any idea how many programs set this option and which ones? You obviously noticed, so perhaps you know at least one or was this discovered purely by code inspection?
We have an application that communicates with a switch and a NIC that helps some additional configuration for the network (think of it as an extended link negotiation). It uses LLDP, which is layer 2 and is multicast. We noticed that when testing bonding, it didn't work. I'm not sure who else might be using this code right now, since it went into the mainstream kernel in 2.6.22.
Thanks,
-PJ
From: PJ Waskiewicz <[email protected]>
Date: Tue, 06 Nov 2007 07:25:47 -0800
Quoted 6 lines
The socket option for packet sockets to return the original ifindex instead of the bonded ifindex will not match multicast traffic. Since this socket option is the most useful for layer 2 traffic and multicast traffic, make the option multicast-aware.
Signed-off-by Peter P Waskiewicz Jr <[email protected]>
Applied, thanks Peter.