summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>2006-08-18 22:36:05 +0000
committerjulian <julian@FreeBSD.org>2006-08-18 22:36:05 +0000
commit2e81f075ec517d298bfed516e8bc69c999f21c11 (patch)
treed5041cb81c60eba877cc6584063a4abd814ee3a9 /sbin
parent1eee061e71e491f1e9f42f75301f2f67346a470f (diff)
downloadFreeBSD-src-2e81f075ec517d298bfed516e8bc69c999f21c11.zip
FreeBSD-src-2e81f075ec517d298bfed516e8bc69c999f21c11.tar.gz
comply with style police
Submitted by: ru MFC after: 1 month
Diffstat (limited to 'sbin')
-rw-r--r--sbin/ipfw/ipfw.814
-rw-r--r--sbin/ipfw/ipfw2.c23
2 files changed, 19 insertions, 18 deletions
diff --git a/sbin/ipfw/ipfw.8 b/sbin/ipfw/ipfw.8
index 6321589..9a746a0 100644
--- a/sbin/ipfw/ipfw.8
+++ b/sbin/ipfw/ipfw.8
@@ -689,8 +689,8 @@ Change the next-hop on matching packets to
.Ar ipaddr ,
which can be an IP address or a host name.
The next hop can also be supplied by the last table
-looked up for the packet by using the
-.Em tablearg
+looked up for the packet by using the
+.Cm tablearg
keyword instead of an explicit address.
The search terminates if this rule matches.
.Pp
@@ -1594,8 +1594,10 @@ action parameters:
rule options:
.Cm limit, tagged.
.Pp
-When used with 'fwd' it is possible to supply table entries with values
-that are in the form of IP addresses or hostnames.
+When used with
+.Cm fwd
+it is possible to supply table entries with values
+that are in the form of IP addresses or hostnames.
See the
.Sx EXAMPLES
Section for example usage of tables and the tablearg keyword.
@@ -2388,7 +2390,9 @@ Then we classify traffic using a single rule:
.Dl "..."
.Dl "ipfw pipe tablearg ip from table(1) to any"
.Pp
-Using the fwd action, the table entries may include hostnames and IP addresses.
+Using the
+.Cn fwd
+action, the table entries may include hostnames and IP addresses.
.Pp
.Dl "ipfw table 1 add 192.168.2.0/24 10.23.2.1"
.Dl "ipfw table 1 add 192.168.0.0/27 router1.dmz"
diff --git a/sbin/ipfw/ipfw2.c b/sbin/ipfw/ipfw2.c
index a486fbe..a461f76 100644
--- a/sbin/ipfw/ipfw2.c
+++ b/sbin/ipfw/ipfw2.c
@@ -4034,11 +4034,10 @@ chkarg:
"illegal forwarding port ``%s''", s);
p->sa.sin_port = (u_short)i;
}
- if (_substrcmp(*av, "tablearg") == 0) {
- p->sa.sin_addr.s_addr = INADDR_ANY; /* htonl not needed */
- } else {
+ if (_substrcmp(*av, "tablearg") == 0)
+ p->sa.sin_addr.s_addr = INADDR_ANY;
+ else
lookup_host(*av, &(p->sa.sin_addr));
- }
ac--; av++;
break;
}
@@ -4998,23 +4997,21 @@ table_handler(int ac, char *av[])
err(EX_OSERR, "getsockopt(IP_FW_TABLE_LIST)");
for (a = 0; a < tbl->cnt; a++) {
/* Heuristic to print it the right way */
- /* valuse < 64k are printed as numbers */
+ /* values < 64k are printed as numbers */
unsigned int tval;
tval = tbl->ent[a].value;
if (tval > 0xffff) {
char tbuf[128];
- strncpy(tbuf,
- inet_ntoa(*(struct in_addr *)
- &tbl->ent[a].addr), 127);
+ strncpy(tbuf, inet_ntoa(*(struct in_addr *)
+ &tbl->ent[a].addr), 127);
/* inet_ntoa expects host order */
tval = htonl(tval);
- printf("%s/%u %s\n",
- tbuf, tbl->ent[a].masklen,
- inet_ntoa(*(struct in_addr *)&tval));
+ printf("%s/%u %s\n", tbuf, tbl->ent[a].masklen,
+ inet_ntoa(*(struct in_addr *)&tval));
} else {
printf("%s/%u %u\n",
- inet_ntoa(*(struct in_addr *)&tbl->ent[a].addr),
- tbl->ent[a].masklen, tbl->ent[a].value);
+ inet_ntoa(*(struct in_addr *)&tbl->ent[a].addr),
+ tbl->ent[a].masklen, tbl->ent[a].value);
}
}
} else
OpenPOWER on IntegriCloud