diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2009-07-21 16:57:54 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2009-07-21 16:57:54 +0200 |
commit | e55321739fa5e04920feeb2a25b02073d8eb9e10 (patch) | |
tree | 1e11aed31eb140fee5ccd9355fc5f914c31c69ca /src/cidr.c | |
parent | 0521db731c0daa417a3dfb67fba7c6f80596e553 (diff) | |
download | conntrack-tools-e55321739fa5e04920feeb2a25b02073d8eb9e10.tar.gz conntrack-tools-e55321739fa5e04920feeb2a25b02073d8eb9e10.zip |
conntrackd: add support for IPv6 kernel-space filtering via BSF
This patch adds the missing support to filter IPv6 from kernel-space
by means of the BSF API that libnetfilter_conntrack provides.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/cidr.c')
-rw-r--r-- | src/cidr.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -57,3 +57,14 @@ void ipv6_cidr2mask_net(uint8_t cidr, uint32_t *res) res[i] = htonl(res[i]); } +/* I need this function because I initially defined an IPv6 address as + * uint32 u[4]. Using char u[16] instead would allow to remove this. */ +void ipv6_addr2addr_host(uint32_t *addr, uint32_t *res) +{ + int i; + + memset(res, 0, sizeof(uint32_t)*4); + for (i = 0; i < 4; i++) { + res[i] = ntohl(addr[i]); + } +} |