Skip to content

Commit

Permalink
*: Remove int return for zapi functions
Browse files Browse the repository at this point in the history
The code never uses the return code for
Zapi functions.  Let's remove it.

Signed-off-by: Donald Sharp <[email protected]>
  • Loading branch information
donaldsharp committed Jan 24, 2024
1 parent a5613bd commit 65b3352
Show file tree
Hide file tree
Showing 32 changed files with 375 additions and 582 deletions.
13 changes: 4 additions & 9 deletions babeld/babel_interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,7 @@ babel_ifp_destroy(struct interface *ifp)
return 0;
}

int
babel_interface_address_add (ZAPI_CALLBACK_ARGS)
void babel_interface_address_add(ZAPI_CALLBACK_ARGS)
{
babel_interface_nfo *babel_ifp;
struct connected *ifc;
Expand All @@ -101,7 +100,7 @@ babel_interface_address_add (ZAPI_CALLBACK_ARGS)
zclient->ibuf, vrf_id);

if (ifc == NULL)
return 0;
return;

prefix = ifc->address;

Expand All @@ -120,12 +119,9 @@ babel_interface_address_add (ZAPI_CALLBACK_ARGS)

send_request(ifc->ifp, NULL, 0);
send_update(ifc->ifp, 0, NULL, 0);

return 0;
}

int
babel_interface_address_delete (ZAPI_CALLBACK_ARGS)
void babel_interface_address_delete(ZAPI_CALLBACK_ARGS)
{
babel_interface_nfo *babel_ifp;
struct connected *ifc;
Expand All @@ -137,7 +133,7 @@ babel_interface_address_delete (ZAPI_CALLBACK_ARGS)
zclient->ibuf, vrf_id);

if (ifc == NULL)
return 0;
return;

prefix = ifc->address;

Expand All @@ -156,7 +152,6 @@ babel_interface_address_delete (ZAPI_CALLBACK_ARGS)
send_update(ifc->ifp, 0, NULL, 0);

connected_free(&ifc);
return 0;
}

/* Lookup function. */
Expand Down
12 changes: 6 additions & 6 deletions babeld/babel_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,12 @@ struct buffered_update {
void babel_if_init(void);

/* Callback functions for zebra client */
int babel_interface_up (int, struct zclient *, zebra_size_t, vrf_id_t);
int babel_interface_down (int, struct zclient *, zebra_size_t, vrf_id_t);
int babel_interface_add (int, struct zclient *, zebra_size_t, vrf_id_t);
int babel_interface_delete (int, struct zclient *, zebra_size_t, vrf_id_t);
int babel_interface_address_add (int, struct zclient *, zebra_size_t, vrf_id_t);
int babel_interface_address_delete (int, struct zclient *, zebra_size_t, vrf_id_t);
void babel_interface_up(ZAPI_CALLBACK_ARGS);
void babel_interface_down(ZAPI_CALLBACK_ARGS);
void babel_interface_add(ZAPI_CALLBACK_ARGS);
void babel_interface_delete(ZAPI_CALLBACK_ARGS);
void babel_interface_address_add(ZAPI_CALLBACK_ARGS);
void babel_interface_address_delete(ZAPI_CALLBACK_ARGS);

int babel_ifp_create(struct interface *ifp);
int babel_ifp_up(struct interface *ifp);
Expand Down
9 changes: 3 additions & 6 deletions babeld/babel_zebra.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,25 +38,22 @@ static const struct {
};

/* Zebra route add and delete treatment. */
static int
babel_zebra_read_route (ZAPI_CALLBACK_ARGS)
static void babel_zebra_read_route(ZAPI_CALLBACK_ARGS)
{
struct zapi_route api;

if (zapi_route_decode(zclient->ibuf, &api) < 0)
return -1;
return;

/* we completely ignore srcdest routes for now. */
if (CHECK_FLAG(api.message, ZAPI_MESSAGE_SRCPFX))
return 0;
return;

if (cmd == ZEBRA_REDISTRIBUTE_ROUTE_ADD) {
babel_route_add(&api);
} else {
babel_route_delete(&api);
}

return 0;
}

/* [Babel Command] */
Expand Down
13 changes: 4 additions & 9 deletions bfdd/ptm_adapter.c
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ static void bfdd_client_deregister(struct stream *msg)
zlog_err("ptm-del-client: failed to deregister client");
}

static int bfdd_replay(ZAPI_CALLBACK_ARGS)
static void bfdd_replay(ZAPI_CALLBACK_ARGS)
{
struct stream *msg = zclient->ibuf;
uint32_t rcmd;
Expand All @@ -614,14 +614,11 @@ static int bfdd_replay(ZAPI_CALLBACK_ARGS)
default:
if (bglobal.debug_zebra)
zlog_debug("ptm-replay: invalid message type %u", rcmd);
return -1;
return;
}

return 0;

stream_failure:
zlog_err("ptm-replay: failed to find command");
return -1;
}

static void bfdd_zebra_connected(struct zclient *zc)
Expand Down Expand Up @@ -779,13 +776,13 @@ static void bfdd_sessions_enable_address(struct connected *ifc)
}
}

static int bfdd_interface_address_update(ZAPI_CALLBACK_ARGS)
static void bfdd_interface_address_update(ZAPI_CALLBACK_ARGS)
{
struct connected *ifc;

ifc = zebra_interface_address_read(cmd, zclient->ibuf, vrf_id);
if (ifc == NULL)
return 0;
return;

if (bglobal.debug_zebra)
zlog_debug("zclient: %s local address %pFX (VRF %u)",
Expand All @@ -797,8 +794,6 @@ static int bfdd_interface_address_update(ZAPI_CALLBACK_ARGS)
bfdd_sessions_enable_address(ifc);
else
connected_free(&ifc);

return 0;
}

static int bfd_ifp_create(struct interface *ifp)
Expand Down
Loading

0 comments on commit 65b3352

Please sign in to comment.