From 8d68a38c806bd25b3c39426dc396cc560b895f76 Mon Sep 17 00:00:00 2001 From: florian Date: Tue, 4 Jul 2017 15:55:22 +0000 Subject: [PATCH] calculate multiples of 4 smarter; from Klemens Nanni --- sbin/ping/ping.c | 4 ++-- 1 file 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; -- 2.20.1