FreeBSD Bugzilla – Attachment 182179 Details for
Bug 218433
Ipfilter ippool table handling source code or man page being incorrect.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Candidate ippool patch.
ippool.diff (text/plain), 5.60 KB, created by
Cy Schubert
on 2017-04-29 19:34:34 UTC
(
hide
)
Description:
Candidate ippool patch.
Filename:
MIME Type:
Creator:
Cy Schubert
Created:
2017-04-29 19:34:34 UTC
Size:
5.60 KB
patch
obsolete
>Index: contrib/ipfilter/man/ippool.8 >=================================================================== >--- contrib/ipfilter/man/ippool.8 (revision 317594) >+++ contrib/ipfilter/man/ippool.8 (working copy) >@@ -6,25 +6,25 @@ > .SH SYNOPSIS > .br > .B ippool >--a [-dnv] [-m <name>] [-o <role>] [-t <type>] [-T ttl] -i <ipaddr>[/<netmask>] >+-a [-dnvR] [-m <name>] [-o <role>] [-t <type>] [-T ttl] -i <ipaddr>[/<netmask>] > .br > .B ippool >--A [-dnv] [-m <name>] [-o <role>] [-S <seed>] [-t <type>] >+-A [-dnvR] [-m <name>] [-o <role>] [-S <seed>] [-t <type>] > .br > .B ippool >--f <file> [-dnuv] >+-f <file> [-dnuvR] > .br > .B ippool > -F [-dv] [-o <role>] [-t <type>] > .br > .B ippool >--l [-dv] [-m <name>] [-t <type>] >+-l [-dvR] [-m <name>] [-t <type>] > .br > .B ippool >--r [-dnv] [-m <name>] [-o <role>] [-t <type>] -i <ipaddr>[/<netmask>] >+-r [-dnvR] [-m <name>] [-o <role>] [-t <type>] -i <ipaddr>[/<netmask>] > .br > .B ippool >--R [-dnv] [-m <name>] [-o <role>] [-t <type>] >+-R [-dnvR] [-m <name>] [-o <role>] [-t <type>] > .br > .B ippool > -s [-dtv] [-M <core>] [-N <namelist>] >@@ -123,6 +123,9 @@ > .B -u > When parsing a configuration file, rather than load new pool data into the > kernel, unload it. >+.TP >+.B -R >+Do not resolve IP addresses to hostnames. > .DT > .SH FILES > .br >Index: contrib/ipfilter/tools/ippool.c >=================================================================== >--- contrib/ipfilter/tools/ippool.c (revision 317594) >+++ contrib/ipfilter/tools/ippool.c (working copy) >@@ -75,13 +75,13 @@ > char *prog; > { > fprintf(stderr, "Usage:\t%s\n", prog); >- fprintf(stderr, "\t-a [-dnv] [-m <name>] [-o <role>] [-t type] [-T ttl] -i <ipaddr>[/netmask]\n"); >- fprintf(stderr, "\t-A [-dnv] [-m <name>] [-o <role>] [-S <seed>] [-t <type>]\n"); >- fprintf(stderr, "\t-f <file> [-dnuv]\n"); >+ fprintf(stderr, "\t-a [-dnvR] [-m <name>] [-o <role>] [-t type] [-T ttl] -i <ipaddr>[/netmask]\n"); >+ fprintf(stderr, "\t-A [-dnvR] [-m <name>] [-o <role>] [-S <seed>] [-t <type>]\n"); >+ fprintf(stderr, "\t-f <file> [-dnuvR]\n"); > fprintf(stderr, "\t-F [-dv] [-o <role>] [-t <type>]\n"); >- fprintf(stderr, "\t-l [-dv] [-m <name>] [-t <type>] [-O <fields>]\n"); >- fprintf(stderr, "\t-r [-dnv] [-m <name>] [-o <role>] [-t type] -i <ipaddr>[/netmask]\n"); >- fprintf(stderr, "\t-R [-dnv] [-m <name>] [-o <role>] [-t <type>]\n"); >+ fprintf(stderr, "\t-l [-dvR] [-m <name>] [-t <type>] [-O <fields>]\n"); >+ fprintf(stderr, "\t-r [-dnvR] [-m <name>] [-o <role>] [-t type] -i <ipaddr>[/netmask]\n"); >+ fprintf(stderr, "\t-R [-dnvR] [-m <name>] [-o <role>] [-t <type>]\n"); > fprintf(stderr, "\t-s [-dtv] [-M <core>] [-N <namelist>]\n"); > exit(1); > } >@@ -99,7 +99,7 @@ > > assigndefined(getenv("IPPOOL_PREDEFINED")); > >- switch (getopt(argc, argv, "aAf:FlnrRsv")) >+ switch (getopt(argc, argv, "aAf:FlrRs")) > { > case 'a' : > err = poolnodecommand(0, argc, argv); >@@ -116,9 +116,6 @@ > case 'l' : > err = poollist(argc, argv); > break; >- case 'n' : >- opts |= OPT_DONOTHING|OPT_DONTOPEN; >- break; > case 'r' : > err = poolnodecommand(1, argc, argv); > break; >@@ -128,9 +125,6 @@ > case 's' : > err = poolstats(argc, argv); > break; >- case 'v' : >- opts |= OPT_VERBOSE; >- break; > default : > exit(1); > } >@@ -207,15 +201,22 @@ > } > break; > case 'T' : >- ttl = atoi(optarg); >- if (ttl < 0) { >- fprintf(stderr, "cannot set negative ttl\n"); >- return -1; >+ if (remove == 0) { >+ ttl = atoi(optarg); >+ if (ttl < 0) { >+ fprintf(stderr, "cannot set negative ttl\n"); >+ return -1; >+ } >+ } else { >+ usage(argv[0]); > } > break; > case 'v' : > opts |= OPT_VERBOSE; > break; >+ default : >+ usage(argv[0]); >+ break; /* keep compiler happy */ > } > > if (argv[optind] != NULL && ipset == 0) { >@@ -262,7 +263,7 @@ > char *argv[]; > { > int type, role, c, err; >- char *poolname; >+ char *poolname, *typearg = NULL; > iphtable_t iph; > ip_pool_t pool; > >@@ -274,7 +275,9 @@ > bzero((char *)&iph, sizeof(iph)); > bzero((char *)&pool, sizeof(pool)); > >- while ((c = getopt(argc, argv, "dm:no:RSv")) != -1) >+ optreset = optind = 1; >+ >+ while ((c = getopt(argc, argv, "dm:no:RSvt:")) != -1) > switch (c) > { > case 'd' : >@@ -295,16 +298,30 @@ > } > break; > case 'R' : >+ /* not in man page */ > opts |= OPT_NORESOLVE; > break; > case 'S' : >- iph.iph_seed = atoi(optarg); >+ if (remove == 0) >+ iph.iph_seed = atoi(optarg); >+ else >+ usage(argv[0]); > break; > case 'v' : > opts |= OPT_VERBOSE; > break; >+ case 't' : >+ type = gettype(optarg, &iph.iph_type); >+ typearg = optarg; >+ break; >+ default : >+ usage(argv[0]); >+ break; /* keep compiler happy */ > } > >+ if (argc - optind > 0) >+ usage(argv[0]); >+ > if (opts & OPT_DEBUG) > fprintf(stderr, "poolcommand: opts = %#x\n", opts); > >@@ -313,9 +330,11 @@ > return -1; > } > >- type = gettype(argv[optind], &iph.iph_type); > if (type == IPLT_NONE) { >- fprintf(stderr, "unknown type '%s'\n", argv[optind]); >+ if (typearg == NULL) >+ usage(argv[0]); >+ else >+ fprintf(stderr, "unknown type '%s'\n", typearg); > return -1; > } > >@@ -382,6 +401,9 @@ > case 'v' : > opts |= OPT_VERBOSE; > break; >+ default : >+ usage(argv[0]); >+ break; /* keep compiler happy */ > } > > if (opts & OPT_DEBUG) >@@ -453,6 +475,9 @@ > case 'v' : > opts |= OPT_VERBOSE; > break; >+ default : >+ usage(argv[0]); >+ break; /* keep compiler happy */ > } > > if (opts & OPT_DEBUG) >@@ -559,6 +584,9 @@ > case 'v' : > opts |= OPT_VERBOSE; > break; >+ default : >+ usage(argv[0]); >+ break; /* keep compiler happy */ > } > > if (opts & OPT_DEBUG) >@@ -703,6 +731,9 @@ > case 'v' : > opts |= OPT_VERBOSE; > break; >+ default : >+ usage(argv[0]); >+ break; /* keep compiler happy */ > } > > if (opts & OPT_DEBUG)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 218433
:
181554
|
182179
|
182201
|
182231
|
182323