aboutgitcodebugslistschat
path: root/ndp.c
diff options
context:
space:
mode:
Diffstat (limited to 'ndp.c')
-rw-r--r--ndp.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ndp.c b/ndp.c
index acc0473..b676825 100644
--- a/ndp.c
+++ b/ndp.c
@@ -27,6 +27,7 @@
#include <net/if.h>
#include <net/if_arp.h>
+#include "checksum.h"
#include "util.h"
#include "passt.h"
#include "tap.h"
@@ -172,8 +173,8 @@ int ndp(struct ctx *c, struct ethhdr *eh, size_t len)
ip6hr->payload_len = htons(sizeof(*ihr) + len);
ip6hr->hop_limit = IPPROTO_ICMPV6;
ihr->icmp6_cksum = 0;
- ihr->icmp6_cksum = csum_ip4(ip6hr, sizeof(*ip6hr) +
- sizeof(*ihr) + len);
+ ihr->icmp6_cksum = csum_unaligned(ip6hr, sizeof(*ip6hr) +
+ sizeof(*ihr) + len, 0);
ip6hr->version = 6;
ip6hr->nexthdr = IPPROTO_ICMPV6;