aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXin Long <lucien.xin@gmail.com>2017-05-08 15:04:04 +0800
committerJiri Pirko <jiri@mellanox.com>2017-05-08 09:55:37 +0200
commit9a9fbff3e75f78cbff76e9dbd1cfa0a05fd1f120 (patch)
treee16089cb49b5d30deed0f86834f5d0869ac244c4
parent3d1e9efa37976fce3546e343a948a582da1dd203 (diff)
downloadlibteam-9a9fbff3e75f78cbff76e9dbd1cfa0a05fd1f120.tar.gz
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>
-rw-r--r--teamd/teamd_lw_nsna_ping.c2
1 files changed, 1 insertions, 1 deletions
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 @@ static int lw_nsnap_receive(struct lw_psr_port_priv *psr_ppriv)
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 */ ||