From owner-freebsd-bugs Thu May 6 3: 0: 6 1999 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id B85CD15997 for ; Thu, 6 May 1999 03:00:03 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id DAA55725; Thu, 6 May 1999 03:00:03 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Date: Thu, 6 May 1999 03:00:03 -0700 (PDT) Message-Id: <199905061000.DAA55725@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Stephen McKay Subject: Re: bin/9308: [PATCH] Flood ping doesn't flood Reply-To: Stephen McKay Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org The following reply was made to PR bin/9308; it has been noted by GNATS. From: Stephen McKay To: freebsd-gnats-submit@freebsd.org Cc: syssgm@detir.qld.gov.au Subject: Re: bin/9308: [PATCH] Flood ping doesn't flood Date: Thu, 06 May 1999 19:58:13 +1000 Back in January, I wrote: > Is your flood ping limp and flagging? ... My word but I've been slack! I even got a version of my patch through the Bruce filter, and it's still not committed! Here's what I'm going to commit soon. It minimally fixes the flood ping problem, and also restores -l behaviour to that described in the manual page. In a couple of days I'll commit it to -stable too, just before the freeze. Stephen. Index: ping.c =================================================================== RCS file: /cvs/src/sbin/ping/ping.c,v retrieving revision 1.43 diff -u -r1.43 ping.c --- ping.c 1999/04/25 22:33:30 1.43 +++ ping.c 1999/05/05 15:57:24 @@ -274,11 +274,10 @@ if (*ep || ep == optarg || ultmp > INT_MAX) errx(EX_USAGE, "invalid preload value: `%s'", optarg); - if (getuid()) { + if (uid) { errno = EPERM; err(EX_NOPERM, "-l flag"); } - options |= F_FLOOD; preload = ultmp; break; case 'L': @@ -554,6 +553,8 @@ if (timeout.tv_sec < 0) timeout.tv_sec = timeout.tv_usec = 0; n = select(s + 1, &rfds, NULL, NULL, &timeout); + if (n < 0) + continue; /* Must be EINTR. */ if (n == 1) { struct timeval *t = 0; #ifdef SO_TIMESTAMP @@ -585,13 +586,14 @@ if (npackets && nreceived >= npackets) break; } - if (n == 0) { + if (n == 0 || options & F_FLOOD) { if (!npackets || ntransmitted < npackets) pinger(); else { if (almost_done) break; almost_done = 1; + intvl.tv_usec = 0; if (nreceived) { intvl.tv_sec = 2 * tmax / 1000; if (!intvl.tv_sec) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message