summaryrefslogtreecommitdiffstats
path: root/sbin/ipfw/ipfw2.c
diff options
context:
space:
mode:
authorae <ae@FreeBSD.org>2011-05-30 05:37:26 +0000
committerae <ae@FreeBSD.org>2011-05-30 05:37:26 +0000
commit5251d374e6bf12e432d3d911ba9be1ba950711bd (patch)
tree9cb3d9828f584d16f0e0e24c97a40faf6f54c123 /sbin/ipfw/ipfw2.c
parent1d72c8b97a4c5966263541277038a012dbc50ea8 (diff)
downloadFreeBSD-src-5251d374e6bf12e432d3d911ba9be1ba950711bd.zip
FreeBSD-src-5251d374e6bf12e432d3d911ba9be1ba950711bd.tar.gz
Add tablearg support for ipfw setfib.
PR: kern/156410 MFC after: 2 weeks
Diffstat (limited to 'sbin/ipfw/ipfw2.c')
-rw-r--r--sbin/ipfw/ipfw2.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/sbin/ipfw/ipfw2.c b/sbin/ipfw/ipfw2.c
index ad871fe..3e85de3 100644
--- a/sbin/ipfw/ipfw2.c
+++ b/sbin/ipfw/ipfw2.c
@@ -2835,14 +2835,19 @@ chkarg:
size_t intsize = sizeof(int);
action->opcode = O_SETFIB;
- NEED1("missing fib number");
- action->arg1 = strtoul(*av, NULL, 10);
- if (sysctlbyname("net.fibs", &numfibs, &intsize, NULL, 0) == -1)
- errx(EX_DATAERR, "fibs not suported.\n");
- if (action->arg1 >= numfibs) /* Temporary */
- errx(EX_DATAERR, "fib too large.\n");
- av++;
- break;
+ NEED1("missing fib number");
+ if (_substrcmp(*av, "tablearg") == 0) {
+ action->arg1 = IP_FW_TABLEARG;
+ } else {
+ action->arg1 = strtoul(*av, NULL, 10);
+ if (sysctlbyname("net.fibs", &numfibs, &intsize,
+ NULL, 0) == -1)
+ errx(EX_DATAERR, "fibs not suported.\n");
+ if (action->arg1 >= numfibs) /* Temporary */
+ errx(EX_DATAERR, "fib too large.\n");
+ }
+ av++;
+ break;
}
case TOK_REASS:
OpenPOWER on IntegriCloud