]> git.proxmox.com Git - mirror_frr.git/commit - babeld/babel_zebra.c
*: convert zclient callbacks to table
authorDavid Lamparter <equinox@opensourcerouting.org>
Wed, 20 Oct 2021 11:07:47 +0000 (13:07 +0200)
committerDavid Lamparter <equinox@opensourcerouting.org>
Wed, 20 Oct 2021 11:28:46 +0000 (13:28 +0200)
commita243d1db93aaa123413a754fe69fbad36d810ae7
tree3d2e74c2b3f4d4862f7a7029c2ff5d18d71999ae
parentbf4af4ffb5e2ffa0b34c5bd67b5b7d4aa912747f
*: 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>
28 files changed:
babeld/babel_zebra.c
bfdd/ptm_adapter.c
bgpd/bgp_zebra.c
bgpd/rfapi/vnc_zebra.c
eigrpd/eigrp_zebra.c
isisd/isis_zebra.c
ldpd/lde.c
ldpd/ldp_zebra.c
lib/bfd.c
lib/zclient.c
lib/zclient.h
nhrpd/netlink_arp.c
nhrpd/nhrp_route.c
nhrpd/nhrpd.h
ospf6d/ospf6_zebra.c
ospfd/ospf_zebra.c
pathd/path_zebra.c
pbrd/pbr_zebra.c
pimd/pim_mlag.c
pimd/pim_mlag.h
pimd/pim_zebra.c
pimd/pim_zlookup.c
ripd/rip_zebra.c
ripngd/ripng_zebra.c
sharpd/sharp_zebra.c
staticd/static_zebra.c
tests/bgpd/test_mpath.c
vrrpd/vrrp_zebra.c