Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 Aug 2019 16:09:27 +0000 (UTC)
From:      Alan Somers <asomers@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r351082 - head/sbin/ping6
Message-ID:  <201908151609.x7FG9RZe090719@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: asomers
Date: Thu Aug 15 16:09:27 2019
New Revision: 351082
URL: https://svnweb.freebsd.org/changeset/base/351082

Log:
  ping6: fix uninitialized variable warning for intvl
  
  GCC isn't smart enough to realize that this variable was always initialized.
  
  Submitted by:	Ján Sučan <sucanjan@gmail.com>
  MFC after:	2 weeks
  Sponsored by:	Google, inc. (Google Summer of Code 2019)
  Differential Revision:	https://reviews.freebsd.org/D21271

Modified:
  head/sbin/ping6/ping6.c

Modified: head/sbin/ping6/ping6.c
==============================================================================
--- head/sbin/ping6/ping6.c	Thu Aug 15 16:04:22 2019	(r351081)
+++ head/sbin/ping6/ping6.c	Thu Aug 15 16:09:27 2019	(r351082)
@@ -333,6 +333,9 @@ main(int argc, char *argv[])
 	memset(&smsghdr, 0, sizeof(smsghdr));
 	memset(&smsgiov, 0, sizeof(smsgiov));
 
+	intvl.tv_sec = interval / 1000;
+	intvl.tv_nsec = interval % 1000 * 1000000;
+
 	alarmtimeout = preload = 0;
 	datap = &outpack[ICMP6ECHOLEN + ICMP6ECHOTMLEN];
 	capdns = capdns_setup();
@@ -1121,9 +1124,6 @@ main(int argc, char *argv[])
 	if (options & F_FLOOD) {
 		intvl.tv_sec = 0;
 		intvl.tv_nsec = 10000000;
-	} else if ((options & F_INTERVAL) == 0) {
-		intvl.tv_sec = interval / 1000;
-		intvl.tv_nsec = interval % 1000 * 1000000;
 	}
 
 	almost_done = 0;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201908151609.x7FG9RZe090719>