mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-08 18:20:15 +00:00
zebra: fix coverity SA warnings
Fix a few coverity warnings. Signed-off-by: Mark Stapp <mjs@voltanet.io>
This commit is contained in:
parent
bdabd4b958
commit
2896f40e69
@ -1561,7 +1561,8 @@ static void nhlfe_print(zebra_nhlfe_t *nhlfe, struct vty *vty)
|
|||||||
case NEXTHOP_TYPE_IPV6:
|
case NEXTHOP_TYPE_IPV6:
|
||||||
case NEXTHOP_TYPE_IPV6_IFINDEX:
|
case NEXTHOP_TYPE_IPV6_IFINDEX:
|
||||||
vty_out(vty, " via %s",
|
vty_out(vty, " via %s",
|
||||||
inet_ntop(AF_INET6, &nexthop->gate.ipv6, buf, BUFSIZ));
|
inet_ntop(AF_INET6, &nexthop->gate.ipv6, buf,
|
||||||
|
sizeof(buf)));
|
||||||
if (nexthop->ifindex)
|
if (nexthop->ifindex)
|
||||||
vty_out(vty, " dev %s",
|
vty_out(vty, " dev %s",
|
||||||
ifindex2ifname(nexthop->ifindex,
|
ifindex2ifname(nexthop->ifindex,
|
||||||
|
@ -1001,12 +1001,13 @@ static int compare_state(struct route_entry *r1, struct route_entry *r2)
|
|||||||
static int send_client(struct rnh *rnh, struct zserv *client,
|
static int send_client(struct rnh *rnh, struct zserv *client,
|
||||||
enum rnh_type type, vrf_id_t vrf_id)
|
enum rnh_type type, vrf_id_t vrf_id)
|
||||||
{
|
{
|
||||||
struct stream *s;
|
struct stream *s = NULL;
|
||||||
struct route_entry *re;
|
struct route_entry *re;
|
||||||
unsigned long nump;
|
unsigned long nump;
|
||||||
uint8_t num;
|
uint8_t num;
|
||||||
struct nexthop *nh;
|
struct nexthop *nh;
|
||||||
struct route_node *rn;
|
struct route_node *rn;
|
||||||
|
int ret;
|
||||||
int cmd = (type == RNH_IMPORT_CHECK_TYPE) ? ZEBRA_IMPORT_CHECK_UPDATE
|
int cmd = (type == RNH_IMPORT_CHECK_TYPE) ? ZEBRA_IMPORT_CHECK_UPDATE
|
||||||
: ZEBRA_NEXTHOP_UPDATE;
|
: ZEBRA_NEXTHOP_UPDATE;
|
||||||
|
|
||||||
@ -1032,7 +1033,7 @@ static int send_client(struct rnh *rnh, struct zserv *client,
|
|||||||
flog_err(EC_ZEBRA_RNH_UNKNOWN_FAMILY,
|
flog_err(EC_ZEBRA_RNH_UNKNOWN_FAMILY,
|
||||||
"%s: Unknown family (%d) notification attempted\n",
|
"%s: Unknown family (%d) notification attempted\n",
|
||||||
__func__, rn->p.family);
|
__func__, rn->p.family);
|
||||||
break;
|
goto failure;
|
||||||
}
|
}
|
||||||
if (re) {
|
if (re) {
|
||||||
struct zapi_nexthop znh;
|
struct zapi_nexthop znh;
|
||||||
@ -1047,7 +1048,10 @@ static int send_client(struct rnh *rnh, struct zserv *client,
|
|||||||
for (ALL_NEXTHOPS(re->nhe->nhg, nh))
|
for (ALL_NEXTHOPS(re->nhe->nhg, nh))
|
||||||
if (rnh_nexthop_valid(re, nh)) {
|
if (rnh_nexthop_valid(re, nh)) {
|
||||||
zapi_nexthop_from_nexthop(&znh, nh);
|
zapi_nexthop_from_nexthop(&znh, nh);
|
||||||
zapi_nexthop_encode(s, &znh, 0 /* flags */);
|
ret = zapi_nexthop_encode(s, &znh, 0/*flags*/);
|
||||||
|
if (ret < 0)
|
||||||
|
goto failure;
|
||||||
|
|
||||||
num++;
|
num++;
|
||||||
}
|
}
|
||||||
stream_putc_at(s, nump, num);
|
stream_putc_at(s, nump, num);
|
||||||
@ -1063,6 +1067,11 @@ static int send_client(struct rnh *rnh, struct zserv *client,
|
|||||||
client->nh_last_upd_time = monotime(NULL);
|
client->nh_last_upd_time = monotime(NULL);
|
||||||
client->last_write_cmd = cmd;
|
client->last_write_cmd = cmd;
|
||||||
return zserv_send_message(client, s);
|
return zserv_send_message(client, s);
|
||||||
|
|
||||||
|
failure:
|
||||||
|
if (s)
|
||||||
|
stream_free(s);
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void print_nh(struct nexthop *nexthop, struct vty *vty)
|
static void print_nh(struct nexthop *nexthop, struct vty *vty)
|
||||||
|
Loading…
Reference in New Issue
Block a user