commit | 1df73fe8313f806984b446f7751241eccc33a4ee | [log] [tgz] |
---|---|---|
author | Simon Kelley <simon@thekelleys.org.uk> | Thu Mar 05 17:41:04 2020 +0000 |
committer | Simon Kelley <simon@thekelleys.org.uk> | Thu Mar 05 17:51:17 2020 +0000 |
tree | 3a584cc04048ff8f71a8ff1ff8b5200e022c6eec | |
parent | c125c1dfeee7ad11bf4a64fd8427617a3861d759 [diff] |
Remove compiler warnings in IPv6 checksum code in dump.c
diff --git a/src/dump.c b/src/dump.c index d7ed774..9bd3a5f 100644 --- a/src/dump.c +++ b/src/dump.c
@@ -132,8 +132,12 @@ } /* start UDP checksum */ - for (sum = 0, i = 0; i < IN6ADDRSZ; i++) - sum += ((u16 *)&ip6.ip6_src)[i]; + for (sum = 0, i = 0; i < IN6ADDRSZ; i+=2) + { + sum += ip6.ip6_src.s6_addr[i] + (ip6.ip6_src.s6_addr[i+1] << 8) ; + sum += ip6.ip6_dst.s6_addr[i] + (ip6.ip6_dst.s6_addr[i+1] << 8) ; + + } } else {