]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
json: fix json_events_cb() declaration when libjansson is not present
authorLaura Garcia Liebana <nevola@gmail.com>
Wed, 31 Oct 2018 11:54:18 +0000 (12:54 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 31 Oct 2018 14:52:06 +0000 (15:52 +0100)
When nftables is configured without libjansson support, the following
compilation error is shown:

monitor.c: In function ‘netlink_echo_callback’:
monitor.c:910:10: error: too many arguments to function ‘json_events_cb’
   return json_events_cb(nlh, &echo_monh);
          ^~~~~~~~~~~~~~

This patch makes a declaration of the json_events_cb() function
consistent.

Fixes: bb32d8db9a12 ("JSON: Add support for echo option")
Signed-off-by: Laura Garcia Liebana <nevola@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/json.h

index 8d45c3c32f13697eba4dee5496245376c2abb0dc..c724c299766be3455a72b060bbb98dbd95f7dc23 100644 (file)
@@ -239,7 +239,8 @@ static inline void monitor_print_rule_json(struct netlink_mon_handler *monh,
        /* empty */
 }
 
-static inline int json_events_cb(const struct nlmsghdr *nlh)
+static inline int json_events_cb(const struct nlmsghdr *nlh,
+                                 struct netlink_mon_handler *monh)
 {
        return -1;
 }