From a243d1db93aaa123413a754fe69fbad36d810ae7 Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Wed, 20 Oct 2021 13:07:47 +0200 Subject: *: convert zclient callbacks to table This removes a giant `switch { }` block from lib/zclient.c and harmonizes all zclient callback function types to be the same (some had a subset of the args, some had a void return, now they all have ZAPI_CALLBACK_ARGS and int return.) Apart from getting rid of the giant switch, this is a minor security benefit since the function pointers are now in a `const` array, so they can't be overwritten by e.g. heap overflows for code execution anymore. Signed-off-by: David Lamparter --- nhrpd/nhrpd.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'nhrpd/nhrpd.h') diff --git a/nhrpd/nhrpd.h b/nhrpd/nhrpd.h index 17abb0476..96caa3904 100644 --- a/nhrpd/nhrpd.h +++ b/nhrpd/nhrpd.h @@ -363,8 +363,8 @@ int nhrp_interface_up(ZAPI_CALLBACK_ARGS); int nhrp_interface_down(ZAPI_CALLBACK_ARGS); int nhrp_interface_address_add(ZAPI_CALLBACK_ARGS); int nhrp_interface_address_delete(ZAPI_CALLBACK_ARGS); -void nhrp_neighbor_operation(ZAPI_CALLBACK_ARGS); -void nhrp_gre_update(ZAPI_CALLBACK_ARGS); +int nhrp_neighbor_operation(ZAPI_CALLBACK_ARGS); +int nhrp_gre_update(ZAPI_CALLBACK_ARGS); void nhrp_interface_notify_add(struct interface *ifp, struct notifier_block *n, notifier_fn_t fn); -- cgit v1.2.3