From 9658b6b3f4f37d543575cebbca9f4ab5d4e77ced Mon Sep 17 00:00:00 2001 From: Cy Schubert Date: Tue, 18 Feb 2020 11:26:49 +0000 Subject: [PATCH] As with ipf(8), give ippool(8) the ability to load IP pools from multiple files. This allows for loading, during the same invocation of ippool, of multiple sources of input using multiple tools to concurrently maintain the files such as fail2ban, macro preprocessors, and manually. MFC after: 1 week --- contrib/ipfilter/man/ippool.8 | 2 +- contrib/ipfilter/tools/ippool.c | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/contrib/ipfilter/man/ippool.8 b/contrib/ipfilter/man/ippool.8 index ea9664c37d6c..3411ac19f409 100644 --- a/contrib/ipfilter/man/ippool.8 +++ b/contrib/ipfilter/man/ippool.8 @@ -12,7 +12,7 @@ ippool \- user interface to the IPFilter pools -A [-dnv] [-m ] [-o ] [-S ] -t .br .B ippool --f [-dnuv] +-f [-dnuv] [-f ] [-t ] diff --git a/contrib/ipfilter/tools/ippool.c b/contrib/ipfilter/tools/ippool.c index 4785d65c8db4..34800d92defa 100644 --- a/contrib/ipfilter/tools/ippool.c +++ b/contrib/ipfilter/tools/ippool.c @@ -381,13 +381,17 @@ loadpoolfile(argc, argv, infile) { int c; - while ((c = getopt(argc, argv, "dnuv")) != -1) + while ((c = getopt(argc, argv, "dnuvf:")) != -1) switch (c) { case 'd' : opts |= OPT_DEBUG; ippool_yydebug++; break; + case 'f' : + if (loadpoolfile(argc, argv, optarg) != 0) + return(-1); + break; case 'n' : opts |= OPT_DONOTHING|OPT_DONTOPEN; break;