diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2013-08-06 15:11:27 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2013-08-06 15:12:30 +0200 |
commit | e38ff8f127b61f879f57439e37c1ad9b9bc10a04 (patch) | |
tree | 5eb5e06b7f2607dec2ca6afcb75628551969ae22 /src | |
parent | 8e9906b69b03eb12fc75e857a347c4505332b820 (diff) | |
download | conntrack-tools-e38ff8f127b61f879f57439e37c1ad9b9bc10a04.tar.gz conntrack-tools-e38ff8f127b61f879f57439e37c1ad9b9bc10a04.zip |
cthelper: fix IPv6 address and mask in newly created expectations
Set to zero the entire address if needed, not just 4 bytes.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/expect.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/expect.c b/src/expect.c index 6069770..470b9ae 100644 --- a/src/expect.c +++ b/src/expect.c @@ -54,7 +54,7 @@ cthelper_expect_init(struct nf_expect *exp, struct nf_conntrack *master, nfct_set_attr(expected, ATTR_IPV6_SRC, saddr->ip6); for (i=0; i<4; i++) - memset(addr, 0xffffffff, sizeof(uint32_t)); + memset(&addr[i], 0xffffffff, sizeof(uint32_t)); nfct_set_attr_u8(mask, ATTR_L3PROTO, AF_INET6); nfct_set_attr(mask, ATTR_IPV6_SRC, addr); @@ -76,7 +76,7 @@ cthelper_expect_init(struct nf_expect *exp, struct nf_conntrack *master, break; case AF_INET6: for (i=0; i<4; i++) - memset(addr, 0x00000000, sizeof(uint32_t)); + memset(&addr[i], 0x00000000, sizeof(uint32_t)); nfct_set_attr_u8(expected, ATTR_L3PROTO, AF_INET6); nfct_set_attr(expected, ATTR_IPV6_SRC, addr); |