From: Eric Dumazet Date: Sat, 4 Nov 2017 15:27:14 +0000 (-0700) Subject: pktgen: do not abuse IN6_ADDR_HSIZE X-Git-Tag: v4.19~2168^2~135 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=df7e8e2e3e59fe29c24f09d7c3b68e732d661af3;p=platform%2Fkernel%2Flinux-rpi.git pktgen: do not abuse IN6_ADDR_HSIZE pktgen accidentally used IN6_ADDR_HSIZE, instead of using the size of an IPv6 address. Since IN6_ADDR_HSIZE recently was increased from 16 to 256, this old bug is hitting us. Fixes: 3f27fb23219e ("ipv6: addrconf: add per netns perturbation in inet6_addr_hash()") Signed-off-by: Eric Dumazet Reported-by: Dan Carpenter Signed-off-by: David S. Miller --- diff --git a/net/core/pktgen.c b/net/core/pktgen.c index 6e1e10f..e3fa53a 100644 --- a/net/core/pktgen.c +++ b/net/core/pktgen.c @@ -2165,7 +2165,7 @@ static void pktgen_setup_inject(struct pktgen_dev *pkt_dev) + pkt_dev->pkt_overhead; } - for (i = 0; i < IN6_ADDR_HSIZE; i++) + for (i = 0; i < sizeof(struct in6_addr); i++) if (pkt_dev->cur_in6_saddr.s6_addr[i]) { set = 1; break;