teamd: check ipv6 packet only with the 4 bits version
Now in lw_nsnap_receive, it checks if the packet is ipv6 or not by
ip6h.ip6_vfc != 0x60. But ip6_vfc in ipv6 header is 4 bits version
and top 4 bits tclass.
The na packet from some switch may set this top 4 bits tclass. It
will cause to fail to validate the ipv6 na packet, and nsna_ping
couldn't work.
This patch is to fix it by only using the 4 bits version to check
ipv6 packet.
Reported-by: Amit Supugade <asupugad@redhat.com>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
diff --git a/teamd/teamd_lw_nsna_ping.c b/teamd/teamd_lw_nsna_ping.c
index 1be8323..4f5dfcd 100644
--- a/teamd/teamd_lw_nsna_ping.c
+++ b/teamd/teamd_lw_nsna_ping.c
@@ -247,7 +247,7 @@
return err;
/* check IPV6 header */
- if (nap.ip6h.ip6_vfc != 0x60 /* IPV6 */ ||
+ if ((nap.ip6h.ip6_vfc & 0xf0) != 0x60 /* IPV6 */ ||
nap.ip6h.ip6_plen != htons(sizeof(nap) - sizeof(nap.ip6h)) ||
nap.ip6h.ip6_nxt != IPPROTO_ICMPV6 ||
nap.ip6h.ip6_hlim != 255 /* Do not route */ ||