Commit e32e3d0a authored by Eric S. Raymond's avatar Eric S. Raymond
Browse files

Too many members named 'count'. Distinguish one. No logic changes.

parent d22a11af
Pipeline #10978663 passed with stages
in 12 minutes and 2 seconds
......@@ -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 */
......
......@@ -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:
......
......@@ -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
......
......@@ -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);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment