summaryrefslogtreecommitdiff
path: root/addr_hash.c
diff options
context:
space:
mode:
authorpdw <>2011-10-03 20:21:55 +0000
committerpdw <>2011-10-03 20:21:55 +0000
commitfc511cfea99e21c5359259728b360670abcd8068 (patch)
treefb277e1270b5a4b7b3f67d55b258d1e1db1beed0 /addr_hash.c
parentcd57e7672730bfb08bf087d090601e168e7d69d7 (diff)
downloadiftop-fc511cfea99e21c5359259728b360670abcd8068.zip
Patch from Scott Bertilson <ssb@umn.edu> to remove dependence on s6_addr32.
Diffstat (limited to 'addr_hash.c')
-rw-r--r--addr_hash.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/addr_hash.c b/addr_hash.c
index 135709c..70e5ff1 100644
--- a/addr_hash.c
+++ b/addr_hash.c
@@ -43,7 +43,7 @@ int hash(void* key) {
addr_pair* ap = (addr_pair*)key;
if (ap->af == AF_INET6) {
- uint32_t* addr6 = ap->src6.s6_addr32;
+ uint32_t* addr6 = (uint32_t*)ap->src6.s6_addr;
hash = ( hash_uint32(addr6[0])
+ hash_uint32(addr6[1])
@@ -51,7 +51,7 @@ int hash(void* key) {
+ hash_uint32(addr6[3])
+ ap->src_port) % 0xFF;
- addr6 = ap->dst6.s6_addr32;
+ addr6 = (uint32_t*)ap->dst6.s6_addr;
hash = ( hash + hash_uint32(addr6[0])
+ hash_uint32(addr6[1])
+ hash_uint32(addr6[2])