diff options
author | Eric Dumazet <edumazet@google.com> | 2017-11-04 18:27:14 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-11-05 03:16:46 +0300 |
commit | df7e8e2e3e59fe29c24f09d7c3b68e732d661af3 (patch) | |
tree | 35487079bab6f5b1db6ada128c6361b285b20374 | |
parent | 0f04d057515275099c6e4f767b95a278be4681bf (diff) | |
download | linux-df7e8e2e3e59fe29c24f09d7c3b68e732d661af3.tar.xz |
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 <edumazet@google.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/core/pktgen.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/core/pktgen.c b/net/core/pktgen.c index 6e1e10ff433a..e3fa53a07d34 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; |