[Git][NTPsec/ntpsec][master] Too many members named 'count'. Distinguish one. No logic changes.

Eric S. Raymond gitlab at mg.gitlab.com
Fri Aug 18 11:38:57 UTC 2017


Eric S. Raymond pushed to branch master at NTPsec / ntpsec


Commits:
e32e3d0a by Eric S. Raymond at 2017-08-18T07:36:13-04:00
Too many members named 'count'. Distinguish one. No logic changes.

- - - - -


4 changed files:

- include/ntp.h
- ntpd/ntp_control.c
- ntpd/ntp_restrict.c
- tests/ntpd/restrict.c


Changes:

=====================================
include/ntp.h
=====================================
--- a/include/ntp.h
+++ b/include/ntp.h
@@ -654,7 +654,7 @@ typedef struct res_addr6_tag {
 typedef struct restrict_u_tag	restrict_u;
 struct restrict_u_tag {
 	restrict_u *		link;	/* link to next entry */
-	uint32_t		count;	/* number of packets matched */
+	uint32_t		hitcount;	/* number of packets matched */
 	unsigned short		flags;	/* accesslist flags */
 	unsigned short		mflags;	/* match flags */
 	unsigned long		expire;	/* valid until time */


=====================================
ntpd/ntp_control.c
=====================================
--- a/ntpd/ntp_control.c
+++ b/ntpd/ntp_control.c
@@ -3874,7 +3874,7 @@ send_restrict_entry(
 
 		case 2:
 			snprintf(tag, sizeof(tag), hits_fmt, idx);
-			ctl_putuint(tag, pres->count);
+			ctl_putuint(tag, pres->hitcount);
 			break;
 
 		case 3:


=====================================
ntpd/ntp_restrict.c
=====================================
--- a/ntpd/ntp_restrict.c
+++ b/ntpd/ntp_restrict.c
@@ -433,7 +433,7 @@ restrictions(
 
 		match = match_restrict4_addr(SRCADR(srcadr),
 					     SRCPORT(srcadr));
-		match->count++;
+		match->hitcount++;
 		/*
 		 * res_not_found counts only use of the final default
 		 * entry, not any "restrict default ntpport ...", which
@@ -459,7 +459,7 @@ restrictions(
 			return (int)RES_IGNORE;
 
 		match = match_restrict6_addr(pin6, SRCPORT(srcadr));
-		match->count++;
+		match->hitcount++;
 		if (&restrict_def6 == match)
 			res_not_found++;
 		else


=====================================
tests/ntpd/restrict.c
=====================================
--- a/tests/ntpd/restrict.c
+++ b/tests/ntpd/restrict.c
@@ -63,14 +63,14 @@ TEST(hackrestrict, RestrictionsAreEmptyAfterInit) {
 	memset(rl4, 0, sizeof(restrict_u));
 	memset(rl6, 0, sizeof(restrict_u));
 
-	TEST_ASSERT_EQUAL(rl4->count, restrictlist4->count);
+	TEST_ASSERT_EQUAL(rl4->hitcount, restrictlist4->hitcount);
 	TEST_ASSERT_EQUAL(rl4->flags, restrictlist4->flags);
 	TEST_ASSERT_EQUAL(rl4->mflags, restrictlist4->mflags);
 	TEST_ASSERT_EQUAL(rl4->expire, restrictlist4->expire);
 	TEST_ASSERT_EQUAL(rl4->u.v4.addr, restrictlist4->u.v4.addr);
 	TEST_ASSERT_EQUAL(rl4->u.v4.mask, restrictlist4->u.v4.mask);
 
-	TEST_ASSERT_EQUAL(rl6->count, restrictlist6->count);
+	TEST_ASSERT_EQUAL(rl6->hitcount, restrictlist6->hitcount);
 	TEST_ASSERT_EQUAL(rl6->flags, restrictlist6->flags);
 	TEST_ASSERT_EQUAL(rl6->mflags, restrictlist6->mflags);
 	TEST_ASSERT_EQUAL(rl6->expire, restrictlist6->expire);



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

---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/e32e3d0aac8d1d31d17dbead76b0774ad8b8ef85
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/20170818/2243f691/attachment.html>


More information about the vc mailing list