mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-14 18:01:54 +00:00
lib,bgpd,babeld,ripngd,nhrpd,bfdd: clean up SA warnings
Clean up several SA warnings. Signed-off-by: Mark Stapp <mjs@voltanet.io>
This commit is contained in:
parent
695a52fd5e
commit
fa3bf3a21b
@ -1115,7 +1115,9 @@ really_send_update(struct interface *ifp,
|
||||
if(channels_len >= 0) {
|
||||
accumulate_byte(ifp, 2);
|
||||
accumulate_byte(ifp, channels_len);
|
||||
accumulate_bytes(ifp, channels, channels_len);
|
||||
|
||||
if (channels && channels_len > 0)
|
||||
accumulate_bytes(ifp, channels, channels_len);
|
||||
}
|
||||
end_message(ifp, MESSAGE_UPDATE, 10 + (real_plen + 7) / 8 - omit +
|
||||
channels_size);
|
||||
|
@ -435,16 +435,18 @@ ssize_t bfd_recv_ipv6(int sd, uint8_t *msgbuf, size_t msgbuflen, uint8_t *ttl,
|
||||
#endif /* HAVE_STRUCT_SOCKADDR_SA_LEN */
|
||||
|
||||
*ifindex = pi6->ipi6_ifindex;
|
||||
|
||||
/* Set scope ID for link local addresses. */
|
||||
if (IN6_IS_ADDR_LINKLOCAL(
|
||||
&peer->sa_sin6.sin6_addr))
|
||||
peer->sa_sin6.sin6_scope_id = *ifindex;
|
||||
if (IN6_IS_ADDR_LINKLOCAL(
|
||||
&local->sa_sin6.sin6_addr))
|
||||
local->sa_sin6.sin6_scope_id = *ifindex;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Set scope ID for link local addresses. */
|
||||
if (IN6_IS_ADDR_LINKLOCAL(&peer->sa_sin6.sin6_addr))
|
||||
peer->sa_sin6.sin6_scope_id = *ifindex;
|
||||
if (IN6_IS_ADDR_LINKLOCAL(&local->sa_sin6.sin6_addr))
|
||||
local->sa_sin6.sin6_scope_id = *ifindex;
|
||||
|
||||
return mlen;
|
||||
}
|
||||
|
||||
|
@ -294,6 +294,10 @@ static struct bgp_path_info_mpath *
|
||||
bgp_path_info_mpath_get(struct bgp_path_info *path)
|
||||
{
|
||||
struct bgp_path_info_mpath *mpath;
|
||||
|
||||
if (!path)
|
||||
return NULL;
|
||||
|
||||
if (!path->mpath) {
|
||||
mpath = bgp_path_info_mpath_new();
|
||||
if (!mpath)
|
||||
@ -523,6 +527,7 @@ void bgp_path_info_mpath_update(struct bgp_node *rn,
|
||||
list_delete_node(mp_list, mp_node);
|
||||
bgp_path_info_mpath_dequeue(cur_mpath);
|
||||
if ((mpath_count < maxpaths)
|
||||
&& prev_mpath
|
||||
&& bgp_path_info_nexthop_cmp(prev_mpath,
|
||||
cur_mpath)) {
|
||||
bgp_path_info_mpath_enqueue(prev_mpath,
|
||||
|
@ -1143,6 +1143,9 @@ static int rfapiVpnBiSamePtUn(struct bgp_path_info *bpi1,
|
||||
break;
|
||||
}
|
||||
|
||||
memset(&pfx_un1, 0, sizeof(pfx_un1));
|
||||
memset(&pfx_un2, 0, sizeof(pfx_un2));
|
||||
|
||||
/*
|
||||
* UN address comparisons
|
||||
*/
|
||||
@ -1184,7 +1187,7 @@ static int rfapiVpnBiSamePtUn(struct bgp_path_info *bpi1,
|
||||
}
|
||||
}
|
||||
|
||||
if (!pfx_un1.family || !pfx_un2.family)
|
||||
if (pfx_un1.family == 0 || pfx_un2.family == 0)
|
||||
return 0;
|
||||
|
||||
if (pfx_un1.family != pfx_un2.family)
|
||||
|
@ -151,7 +151,7 @@ int vty_out(struct vty *vty, const char *format, ...)
|
||||
va_list args;
|
||||
ssize_t len;
|
||||
char buf[1024];
|
||||
char *p = buf;
|
||||
char *p = NULL;
|
||||
char *filtered;
|
||||
|
||||
if (vty->frame_pos) {
|
||||
|
@ -207,7 +207,7 @@ static void parse_sa_message(struct vici_message_ctx *ctx,
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (!key)
|
||||
if (!key || !key->ptr)
|
||||
break;
|
||||
|
||||
switch (key->ptr[0]) {
|
||||
@ -550,7 +550,7 @@ int sock_open_unix(const char *path)
|
||||
|
||||
memset(&addr, 0, sizeof(struct sockaddr_un));
|
||||
addr.sun_family = AF_UNIX;
|
||||
strncpy(addr.sun_path, path, sizeof(addr.sun_path) - 1);
|
||||
strlcpy(addr.sun_path, path, sizeof(addr.sun_path));
|
||||
|
||||
ret = connect(fd, (struct sockaddr *)&addr,
|
||||
sizeof(addr.sun_family) + strlen(addr.sun_path));
|
||||
|
@ -184,7 +184,8 @@ static int ripng_if_down(struct interface *ifp)
|
||||
zlog_debug("turn off %s", ifp->name);
|
||||
|
||||
/* Leave from multicast group. */
|
||||
ripng_multicast_leave(ifp, ripng->sock);
|
||||
if (ripng)
|
||||
ripng_multicast_leave(ifp, ripng->sock);
|
||||
|
||||
ri->running = 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user