diff options
| author | David Lamparter <equinox@opensourcerouting.org> | 2021-10-20 13:07:47 +0200 | 
|---|---|---|
| committer | David Lamparter <equinox@opensourcerouting.org> | 2021-10-20 13:28:46 +0200 | 
| commit | a243d1db93aaa123413a754fe69fbad36d810ae7 (patch) | |
| tree | 3d2e74c2b3f4d4862f7a7029c2ff5d18d71999ae /pimd/pim_zlookup.c | |
| parent | bf4af4ffb5e2ffa0b34c5bd67b5b7d4aa912747f (diff) | |
*: 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 <equinox@opensourcerouting.org>
Diffstat (limited to 'pimd/pim_zlookup.c')
| -rw-r--r-- | pimd/pim_zlookup.c | 2 | 
1 files changed, 1 insertions, 1 deletions
diff --git a/pimd/pim_zlookup.c b/pimd/pim_zlookup.c index abf9577bd5..abf1119ac5 100644 --- a/pimd/pim_zlookup.c +++ b/pimd/pim_zlookup.c @@ -137,7 +137,7 @@ void zclient_lookup_new(void)  	struct zclient_options options = zclient_options_default;  	options.synchronous = true; -	zlookup = zclient_new(router->master, &options); +	zlookup = zclient_new(router->master, &options, NULL, 0);  	if (!zlookup) {  		flog_err(EC_LIB_ZAPI_SOCKET, "%s: zclient_new() failure",  			 __func__);  | 
