summaryrefslogtreecommitdiff
path: root/sbin/ping6
diff options
context:
space:
mode:
authorFlorian Obser <florian@cvs.openbsd.org>2016-08-30 11:15:17 +0000
committerFlorian Obser <florian@cvs.openbsd.org>2016-08-30 11:15:17 +0000
commit9d5b3b7aa0cd1b12576d138bf02a5314ede5e0d6 (patch)
treee9caf58ab698c97bfeb11bcdd5159c2c3909de10 /sbin/ping6
parentb6517af456395b4fbb74eb37fb945d01f5118b36 (diff)
Add destination IP to MAC, reduces difference to ping(8).
Diffstat (limited to 'sbin/ping6')
-rw-r--r--sbin/ping6/ping6.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sbin/ping6/ping6.c b/sbin/ping6/ping6.c
index 4cf44add0f9..4f5b5edb155 100644
--- a/sbin/ping6/ping6.c
+++ b/sbin/ping6/ping6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ping6.c,v 1.146 2016/03/03 18:30:48 florian Exp $ */
+/* $OpenBSD: ping6.c,v 1.147 2016/08/30 11:15:16 florian Exp $ */
/* $KAME: ping6.c,v 1.163 2002/10/25 02:19:06 itojun Exp $ */
/*
@@ -814,6 +814,7 @@ pinger(void)
SipHash24_Update(&ctx, &ident, sizeof(ident));
SipHash24_Update(&ctx,
&icp->icmp6_seq, sizeof(icp->icmp6_seq));
+ SipHash24_Update(&ctx, &dst.sin6_addr, sizeof(dst.sin6_addr));
SipHash24_Final(&payload.mac, &ctx);
memcpy(&outpack[ICMP6ECHOLEN],
@@ -920,6 +921,8 @@ pr_pack(u_char *buf, int cc, struct msghdr *mhdr)
SipHash24_Update(&ctx, &ident, sizeof(ident));
SipHash24_Update(&ctx,
&icp->icmp6_seq, sizeof(icp->icmp6_seq));
+ SipHash24_Update(&ctx, &dst.sin6_addr,
+ sizeof(dst.sin6_addr));
SipHash24_Final(mac, &ctx);
if (timingsafe_memcmp(mac, &payload.mac,