summaryrefslogtreecommitdiff
path: root/sbin/ping
diff options
context:
space:
mode:
authorFlorian Obser <florian@cvs.openbsd.org>2017-07-04 15:55:23 +0000
committerFlorian Obser <florian@cvs.openbsd.org>2017-07-04 15:55:23 +0000
commitfc9a65383749c983dccedf37afcd193e97ea35f0 (patch)
treef706ffa2c5bfe04972f3114f1ed844224ad1e84a /sbin/ping
parenteedb091b6a3c3d0a9e682a9c4183b37eedb356d5 (diff)
calculate multiples of 4 smarter; from Klemens Nanni
Diffstat (limited to 'sbin/ping')
-rw-r--r--sbin/ping/ping.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sbin/ping/ping.c b/sbin/ping/ping.c
index 0428dde6606..8dce3d33647 100644
--- a/sbin/ping/ping.c
+++ b/sbin/ping/ping.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ping.c,v 1.219 2017/07/04 15:43:38 florian Exp $ */
+/* $OpenBSD: ping.c,v 1.220 2017/07/04 15:55:22 florian Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -1377,7 +1377,7 @@ pr_ipopt(int hlen, u_char *buf)
!memcmp(cp, old_rr, i) &&
!(options & F_FLOOD)) {
(void)printf("\t(same route)");
- i = ((i + 3) / 4) * 4;
+ i = (i + 3) & ~0x3;
hlen -= i;
cp += i;
break;