summaryrefslogtreecommitdiff
path: root/pimd/pim_mlag.c
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2021-10-20 13:07:47 +0200
committerDavid Lamparter <equinox@opensourcerouting.org>2021-10-20 13:28:46 +0200
commita243d1db93aaa123413a754fe69fbad36d810ae7 (patch)
tree3d2e74c2b3f4d4862f7a7029c2ff5d18d71999ae /pimd/pim_mlag.c
parentbf4af4ffb5e2ffa0b34c5bd67b5b7d4aa912747f (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_mlag.c')
-rw-r--r--pimd/pim_mlag.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/pimd/pim_mlag.c b/pimd/pim_mlag.c
index a06c0a6f4e..55d6e7e0fd 100644
--- a/pimd/pim_mlag.c
+++ b/pimd/pim_mlag.c
@@ -791,8 +791,10 @@ static void pim_mlag_process_mroute_del(struct mlag_mroute_del msg)
pim_mlag_up_peer_del(&msg);
}
-int pim_zebra_mlag_handle_msg(struct stream *s, int len)
+int pim_zebra_mlag_handle_msg(int cmd, struct zclient *zclient,
+ uint16_t zapi_length, vrf_id_t vrf_id)
{
+ struct stream *s = zclient->ibuf;
struct mlag_msg mlag_msg;
char buf[80];
int rc = 0;
@@ -880,7 +882,7 @@ int pim_zebra_mlag_handle_msg(struct stream *s, int len)
/****************End of PIM Mesasge processing handler********************/
-int pim_zebra_mlag_process_up(void)
+int pim_zebra_mlag_process_up(ZAPI_CALLBACK_ARGS)
{
if (PIM_DEBUG_MLAG)
zlog_debug("%s: Received Process-Up from Mlag", __func__);
@@ -908,7 +910,7 @@ static void pim_mlag_param_reset(void)
router->peerlink_rif[0] = '\0';
}
-int pim_zebra_mlag_process_down(void)
+int pim_zebra_mlag_process_down(ZAPI_CALLBACK_ARGS)
{
if (PIM_DEBUG_MLAG)
zlog_debug("%s: Received Process-Down from Mlag", __func__);