From bed0074dafd473d0e0f79afddf3317cf49ef9823 Mon Sep 17 00:00:00 2001 From: florian Date: Tue, 30 Aug 2016 11:15:16 +0000 Subject: [PATCH] Add destination IP to MAC, reduces difference to ping(8). --- sbin/ping6/ping6.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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, -- 2.20.1