From e3a43115edafc4c3a5181ced76e350863af89a44 Mon Sep 17 00:00:00 2001 From: David Gwynne Date: Mon, 20 Apr 2015 00:36:52 +0000 Subject: fold the icmp seq number into the mac. i dont know why i missed this before. --- sbin/ping/ping.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'sbin') diff --git a/sbin/ping/ping.c b/sbin/ping/ping.c index 7ce9b4bbb07..766bce764f5 100644 --- a/sbin/ping/ping.c +++ b/sbin/ping/ping.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ping.c,v 1.120 2015/04/19 12:56:42 dlg Exp $ */ +/* $OpenBSD: ping.c,v 1.121 2015/04/20 00:36:51 dlg Exp $ */ /* $NetBSD: ping.c,v 1.20 1995/08/11 22:37:58 cgd Exp $ */ /* @@ -648,6 +648,7 @@ pinger(void) SipHash24_Init(&ctx, &mac_key); SipHash24_Update(&ctx, tv64, sizeof(*tv64)); SipHash24_Update(&ctx, &ident, sizeof(ident)); + SipHash24_Update(&ctx, &icp->icmp_seq, sizeof(icp->icmp_seq)); SipHash24_Update(&ctx, &whereto.sin_addr, sizeof(whereto.sin_addr)); SipHash24_Final(&payload.mac, &ctx); @@ -747,6 +748,8 @@ pr_pack(char *buf, int cc, struct sockaddr_in *from) SipHash24_Init(&ctx, &mac_key); SipHash24_Update(&ctx, tv64, sizeof(*tv64)); SipHash24_Update(&ctx, &ident, sizeof(ident)); + SipHash24_Update(&ctx, &icp->icmp_seq, + sizeof(icp->icmp_seq)); SipHash24_Update(&ctx, &whereto.sin_addr, sizeof(whereto.sin_addr)); SipHash24_Final(mac, &ctx); -- cgit v1.2.3