diff mbox series

[nft] json: fix json_events_cb() declaration when libjansson is not present

Message ID 20181031115418.rjsji26k26qhs2ps@nevthink
State Accepted
Delegated to: Pablo Neira
Headers show
Series [nft] json: fix json_events_cb() declaration when libjansson is not present | expand

Commit Message

nevola Oct. 31, 2018, 11:54 a.m. UTC
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>
---
 include/json.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Pablo Neira Ayuso Oct. 31, 2018, 2:51 p.m. UTC | #1
On Wed, Oct 31, 2018 at 12:54:18PM +0100, Laura Garcia Liebana wrote:
> 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.

Applied, thanks Laura.
Phil Sutter Oct. 31, 2018, 6:49 p.m. UTC | #2
Hey Laura,

On Wed, Oct 31, 2018 at 12:54:18PM +0100, Laura Garcia Liebana wrote:
> 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>

Oops, thanks for catching this!

Cheers, Phil
diff mbox series

Patch

diff --git a/include/json.h b/include/json.h
index 8d45c3c..c724c29 100644
--- a/include/json.h
+++ b/include/json.h
@@ -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;
 }