From b934ebcd368ebf4d2dd0bf4edabb083fdac82dad Mon Sep 17 00:00:00 2001 From: Jozsef Kadlecsik Date: Mon, 22 Oct 2018 20:01:14 +0200 Subject: 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. --- lib/ipset.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/ipset.c') 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); -- cgit v1.2.3