From: Govindarajulu Varadarajan <_govind(a)gmx.com>
arp_novlan_rpl_flt[] checks if skb->vlan_tci is present and returns 0 if it is
present. This breaks with some of the hardwares/switches which strips of vlan
tag but retains 802.1p priority bits (vlan_id in header will be 0).
Packets with vlan_id 0 should be treated as non-vlan tagged packet.
teamd should process arp reply of non-vlan packets and packets with vlan_id 0.
This patch programs filter such that it checks if vlan_id is 0 if vlan tag is
present.
Signed-off-by: Govindarajulu Varadarajan <_govind(a)gmx.com>
---
teamd/teamd_lw_arp_ping.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/teamd/teamd_lw_arp_ping.c b/teamd/teamd_lw_arp_ping.c
index 75fedb6..01cd6e1 100644
--- a/teamd/teamd_lw_arp_ping.c
+++ b/teamd/teamd_lw_arp_ping.c
@@ -73,6 +73,8 @@ static struct sock_filter arp_novlan_rpl_flt[] = {
BPF_STMT(BPF_LD + BPF_B + BPF_ABS, SKF_AD_OFF + SKF_AD_PROTOCOL),
BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, ETH_P_ARP, 0, 6),
BPF_STMT(BPF_LD + BPF_B + BPF_ABS, SKF_AD_OFF + SKF_AD_VLAN_TAG_PRESENT),
+ BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, 0, 2, 0),
+ BPF_STMT(BPF_LD + BPF_B + BPF_ABS, SKF_AD_OFF + SKF_AD_VLAN_TAG),
BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, 0, 0, 4),
BPF_STMT(BPF_LD + BPF_H + BPF_ABS, OFFSET_ARP_OP_CODE),
BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, ARPOP_REPLY, 1, 0),
--
2.8.0