[Git][NTPsec/ntpsec][master] Remove last_ttl from struct endpt

Hal Murray gitlab at mg.gitlab.com
Sun Jun 25 02:08:28 UTC 2017


Hal Murray pushed to branch master at NTPsec / ntpsec


Commits:
34d7face by Hal Murray at 2017-06-24T01:58:29-07:00
Remove last_ttl from struct endpt

It wasn't used.  I think it was leftover from broadcasting.

- - - - -


4 changed files:

- include/ntp.h
- ntpd/ntp_control.c
- ntpd/ntp_io.c
- pylib/util.py


Changes:

=====================================
include/ntp.h
=====================================
--- a/include/ntp.h
+++ b/include/ntp.h
@@ -141,7 +141,6 @@ typedef struct __endpt {
 	u_short		family;		/* AF_INET/AF_INET6 */
 	u_short		phase;		/* phase in update cycle */
 	uint32_t	flags;		/* interface flags */
-	int		last_ttl;	/* last TTL specified */
 	uint32_t	addr_refid;	/* IPv4 addr or IPv6 hash */
 	u_long		starttime;	/* current_time at creation */
 	volatile long	received;	/* number of incoming packets */


=====================================
ntpd/ntp_control.c
=====================================
--- a/ntpd/ntp_control.c
+++ b/ntpd/ntp_control.c
@@ -3649,7 +3649,6 @@ send_ifstats_entry(
 	const char en_fmt[] =		"en.%u";	/* enabled */
 	const char name_fmt[] =		"name.%u";
 	const char flags_fmt[] =	"flags.%u";
-	const char tl_fmt[] =		"tl.%u";	/* ttl */
 	const char rx_fmt[] =		"rx.%u";
 	const char tx_fmt[] =		"tx.%u";
 	const char txerr_fmt[] =	"txerr.%u";
@@ -3714,37 +3713,32 @@ send_ifstats_entry(
 			break;
 
 		case 5:
-			snprintf(tag, sizeof(tag), tl_fmt, ifnum);
-			ctl_putint(tag, la->last_ttl);
-			break;
-
-		case 6:
 			snprintf(tag, sizeof(tag), rx_fmt, ifnum);
 			ctl_putint(tag, la->received);
 			break;
 
-		case 7:
+		case 6:
 			snprintf(tag, sizeof(tag), tx_fmt, ifnum);
 			ctl_putint(tag, la->sent);
 			break;
 
-		case 8:
+		case 7:
 			snprintf(tag, sizeof(tag), txerr_fmt, ifnum);
 			ctl_putint(tag, la->notsent);
 			break;
 
-		case 9:
+		case 8:
 			snprintf(tag, sizeof(tag), pc_fmt, ifnum);
 			ctl_putuint(tag, la->peercnt);
 			break;
 
-		case 10:
+		case 9:
 			snprintf(tag, sizeof(tag), up_fmt, ifnum);
 			ctl_putuint(tag, current_time - la->starttime);
 			break;
 
 		default:
-			/* huh? */
+			/* Get here if IFSTATS_FIELDS is too big. */
 			break;
 		}
 		sent[which] = true;


=====================================
ntpd/ntp_io.c
=====================================
--- a/ntpd/ntp_io.c
+++ b/ntpd/ntp_io.c
@@ -443,7 +443,6 @@ interface_dump(const endpt *itf)
 	sockaddr_dump(&itf->mask);
 	printf("name = %s\n", itf->name);
 	printf("flags = 0x%08x\n", itf->flags);
-	printf("last_ttl = %d\n", itf->last_ttl);
 	printf("addr_refid = %08x\n", itf->addr_refid);
 	printf("received = %ld\n", itf->received);
 	printf("sent = %ld\n", itf->sent);
@@ -1298,7 +1297,6 @@ refresh_interface(
 		  * reset TTL indication so TTL is is set again
 		  * next time around
 		  */
-		interface->last_ttl = 0;
 		return (interface->fd != INVALID_SOCKET);
 	} else
 		return false;	/* invalid sockets are not refreshable */


=====================================
pylib/util.py
=====================================
--- a/pylib/util.py
+++ b/pylib/util.py
@@ -1030,14 +1030,13 @@ class ReslistSummary:
 class IfstatsSummary:
     "Reusable class for ifstats entry summary generation."
     header = """\
-    interface name                                     send
- #  address/broadcast     drop flag ttl received sent failed peers   uptime
+    interface name                                  send
+ #  address/broadcast     drop flag received sent failed peers   uptime
  """
     width = 74
     # Numbers are the fieldsize
     fields = {'name':  '%-24.24s',
               'flags': '%4x',
-              'tl':    '%3d',
               'rx':    '%6d',
               'tx':    '%6d',
               'txerr': '%6d',
@@ -1055,11 +1054,10 @@ class IfstatsSummary:
             formatted[name] = fmt
         try:
             enFlag = '.' if variables.get('en', False) else 'D'
-            s = ("%3u %-24.24s %c %4s %3s %6s %6s %6s %5s %8s\n    %s\n"
+            s = ("%3u %-24.24s %c %4s %6s %6s %6s %5s %8s\n    %s\n"
                  % (i, formatted['name'],
                     enFlag,
                     formatted['flags'],
-                    formatted['tl'],
                     formatted['rx'],
                     formatted['tx'],
                     formatted['txerr'],



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/34d7facec7a5cce13d1a87b45c47614cf0bc9438

---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/34d7facec7a5cce13d1a87b45c47614cf0bc9438
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20170625/4768e866/attachment.html>


More information about the vc mailing list