summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2013-07-06 12:09:36 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2013-07-06 15:17:25 +0200
commitc4ce3ffb9a9f0288376312206529eb1428f3aeca (patch)
tree02ee0220be0b25cd7ef1556f4e6f0a411f4fc2e3 /src
parentd343b8c554b6a04f6c477841dc4cbb89b5cd1bd9 (diff)
conntrackd: cache: fix hashing based on IPv6 address
Use source and destination address, not only source address for hashing. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src')
-rw-r--r--src/cache-ct.c2
-rw-r--r--src/cache-exp.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/cache-ct.c b/src/cache-ct.c
index 0ad8d2a..a538215 100644
--- a/src/cache-ct.c
+++ b/src/cache-ct.c
@@ -59,7 +59,7 @@ cache_hash6_ct(const struct nf_conntrack *ct, const struct hashtable *table)
uint32_t a[10];
memcpy(&a[0], nfct_get_attr(ct, ATTR_IPV6_SRC), sizeof(uint32_t)*4);
- memcpy(&a[4], nfct_get_attr(ct, ATTR_IPV6_SRC), sizeof(uint32_t)*4);
+ memcpy(&a[4], nfct_get_attr(ct, ATTR_IPV6_DST), sizeof(uint32_t)*4);
a[8] = nfct_get_attr_u8(ct, ATTR_ORIG_L3PROTO) << 16 |
nfct_get_attr_u8(ct, ATTR_ORIG_L4PROTO);
a[9] = nfct_get_attr_u16(ct, ATTR_ORIG_PORT_SRC) << 16 |
diff --git a/src/cache-exp.c b/src/cache-exp.c
index e88877a..9183b2c 100644
--- a/src/cache-exp.c
+++ b/src/cache-exp.c
@@ -59,7 +59,7 @@ cache_hash6_exp(const struct nf_conntrack *ct, const struct hashtable *table)
uint32_t a[10];
memcpy(&a[0], nfct_get_attr(ct, ATTR_IPV6_SRC), sizeof(uint32_t)*4);
- memcpy(&a[4], nfct_get_attr(ct, ATTR_IPV6_SRC), sizeof(uint32_t)*4);
+ memcpy(&a[4], nfct_get_attr(ct, ATTR_IPV6_DST), sizeof(uint32_t)*4);
a[8] = nfct_get_attr_u8(ct, ATTR_ORIG_L3PROTO) << 16 |
nfct_get_attr_u8(ct, ATTR_ORIG_L4PROTO);
a[9] = nfct_get_attr_u16(ct, ATTR_ORIG_PORT_SRC) << 16 |