diff options
author | Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> | 2018-10-22 20:01:14 +0200 |
---|---|---|
committer | Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> | 2018-10-22 20:01:14 +0200 |
commit | b934ebcd368ebf4d2dd0bf4edabb083fdac82dad (patch) | |
tree | ba48c183fe9d244ebf13a418e3e8a22a1ee8c5fc /lib/ipset.c | |
parent | c387170f903a976922de970042f8fdb6ec93a0f8 (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.c | 4 |
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); |