summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sbin/ipfw/ipfw2.c10
-rw-r--r--sys/netinet/ip_fw2.c8
2 files changed, 7 insertions, 11 deletions
diff --git a/sbin/ipfw/ipfw2.c b/sbin/ipfw/ipfw2.c
index b740503..dc9cab7 100644
--- a/sbin/ipfw/ipfw2.c
+++ b/sbin/ipfw/ipfw2.c
@@ -811,7 +811,7 @@ show_ipfw(struct ip_fw *rule)
ipfw_insn_log *logptr = NULL; /* set if we find an O_LOG */
int or_block = 0; /* we are in an or block */
- u_int32_t set_disable = (u_int32_t)(rule->next_rule);
+ u_int32_t set_disable = rule->set_disable;
if (set_disable & (1 << rule->set)) { /* disabled */
if (!show_sets)
@@ -1198,7 +1198,7 @@ show_dyn_ipfw(ipfw_dyn_rule *d)
}
printf("%05d %10qu %10qu (%ds)",
- (int)(d->rule), d->pcnt, d->bcnt, d->expire);
+ d->rulenum, d->pcnt, d->bcnt, d->expire);
switch (d->dyn_type) {
case O_LIMIT_PARENT:
printf(" PARENT %d", d->count);
@@ -1432,7 +1432,7 @@ sets_handler(int ac, char *av[])
err(EX_OSERR, "malloc");
if (getsockopt(s, IPPROTO_IP, IP_FW_GET, data, &nbytes) < 0)
err(EX_OSERR, "getsockopt(IP_FW_GET)");
- set_disable = (u_int32_t)(((struct ip_fw *)data)->next_rule);
+ set_disable = ((struct ip_fw *)data)->set_disable;
for (i = 0, msg = "disable" ; i < 31; i++)
if ( (set_disable & (1<<i))) {
@@ -1618,9 +1618,9 @@ list(int ac, char *av[])
/* already warned */
continue;
for (n = 0, d = dynrules; n < ndyn; n++, d++) {
- if ((int)(d->rule) > rnum)
+ if (d->rulenum > rnum)
break;
- if ((int)(d->rule) == rnum)
+ if (d->rulenum == rnum)
show_dyn_ipfw(d);
}
}
diff --git a/sys/netinet/ip_fw2.c b/sys/netinet/ip_fw2.c
index 9921a43..6a1a2a0 100644
--- a/sys/netinet/ip_fw2.c
+++ b/sys/netinet/ip_fw2.c
@@ -2501,11 +2501,7 @@ ipfw_ctl(struct sockopt *sopt)
for (rule = layer3_chain; rule ; rule = rule->next) {
int i = RULESIZE(rule);
bcopy(rule, bp, i);
- /*
- * abuse 'next_rule' to store the set_disable word
- */
- (u_int32_t)(((struct ip_fw *)bp)->next_rule) =
- set_disable;
+ ((struct ip_fw *)bp)->set_disable = set_disable;
bp = (struct ip_fw *)((char *)bp + i);
}
if (ipfw_dyn_v) {
@@ -2517,7 +2513,7 @@ ipfw_ctl(struct sockopt *sopt)
for ( p = ipfw_dyn_v[i] ; p != NULL ;
p = p->next, dst++ ) {
bcopy(p, dst, sizeof *p);
- (int)dst->rule = p->rule->rulenum ;
+ dst->rulenum = p->rule->rulenum;
/*
* store a non-null value in "next".
* The userland code will interpret a
OpenPOWER on IntegriCloud