aboutgitcodebugslistschat
path: root/tap.c
diff options
context:
space:
mode:
Diffstat (limited to 'tap.c')
-rw-r--r--tap.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/tap.c b/tap.c
index aafc92b..f082901 100644
--- a/tap.c
+++ b/tap.c
@@ -148,9 +148,7 @@ void tap_ip_send(const struct ctx *c, const struct in6_addr *src, uint8_t proto,
uh->check = 0;
} else if (iph->protocol == IPPROTO_ICMP) {
struct icmphdr *ih = (struct icmphdr *)(iph + 1);
-
- ih->checksum = 0;
- ih->checksum = csum_unaligned(ih, len, 0);
+ csum_icmp4(ih, ih + 1, len - sizeof(*ih));
}
if (tap_send(c, buf, len + sizeof(*iph) + sizeof(*eh), 1) < 0)