summaryrefslogtreecommitdiffstats
path: root/lib/ipset.c
diff options
context:
space:
mode:
authorJozsef Kadlecsik <kadlec@blackhole.kfki.hu>2018-10-22 20:01:14 +0200
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>2018-10-22 20:01:14 +0200
commitb934ebcd368ebf4d2dd0bf4edabb083fdac82dad (patch)
treeba48c183fe9d244ebf13a418e3e8a22a1ee8c5fc /lib/ipset.c
parentc387170f903a976922de970042f8fdb6ec93a0f8 (diff)
Prepare the ipset tool to handle multiple protocol versions
From now on the "version" command asks the kernel protocol version too and reports if the userspace - kernel protocols do not match.
Diffstat (limited to 'lib/ipset.c')
-rw-r--r--lib/ipset.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/ipset.c b/lib/ipset.c
index 70189f9..8d05b39 100644
--- a/lib/ipset.c
+++ b/lib/ipset.c
@@ -1090,6 +1090,10 @@ ipset_parse_argv(struct ipset *ipset, int oargc, char *oargv[])
return 0;
printf("%s v%s, protocol version: %u\n",
program_name, program_version, IPSET_PROTOCOL);
+ /* Check kernel protocol version */
+ ipset_cmd(session, IPSET_CMD_NONE, 0);
+ if (ipset_session_report_type(session) != IPSET_NO_ERROR)
+ ipset->standard_error(ipset, p);
if (ipset->interactive)
return 0;
return ipset->custom_error(ipset, p, IPSET_NO_PROBLEM, NULL);