summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Zalamena <rzalamena@users.noreply.github.com>2019-06-06 21:33:25 +0200
committerGitHub <noreply@github.com>2019-06-06 21:33:25 +0200
commit11ce13decb51546ae31a8826d2ad4eb568e480ac (patch)
tree636223182b367f50b3fb440f82c99128b1d5805b
parentMerge pull request #4428 from mjstapp/topo_update_ospf6 (diff)
parentlib,bgpd,babeld,ripngd,nhrpd,bfdd: clean up SA warnings (diff)
downloadfrr-11ce13decb51546ae31a8826d2ad4eb568e480ac.tar.xz
frr-11ce13decb51546ae31a8826d2ad4eb568e480ac.zip
Merge pull request #4457 from mjstapp/fix_sa_warning
bgpd,babeld,bfdd,lib,ripngd,nhrpd: clean up SA warnings
-rw-r--r--babeld/message.c4
-rw-r--r--bfdd/bfd_packet.c14
-rw-r--r--bgpd/bgp_mpath.c5
-rw-r--r--bgpd/rfapi/rfapi_import.c5
-rw-r--r--lib/vty.c2
-rw-r--r--nhrpd/vici.c4
-rw-r--r--ripngd/ripng_interface.c3
7 files changed, 25 insertions, 12 deletions
diff --git a/babeld/message.c b/babeld/message.c
index 794b6e997..d88790824 100644
--- a/babeld/message.c
+++ b/babeld/message.c
@@ -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);
diff --git a/bfdd/bfd_packet.c b/bfdd/bfd_packet.c
index f3acfa416..d68a1ad5f 100644
--- a/bfdd/bfd_packet.c
+++ b/bfdd/bfd_packet.c
@@ -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;
}
diff --git a/bgpd/bgp_mpath.c b/bgpd/bgp_mpath.c
index d5b3d6b19..648c3be47 100644
--- a/bgpd/bgp_mpath.c
+++ b/bgpd/bgp_mpath.c
@@ -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,
diff --git a/bgpd/rfapi/rfapi_import.c b/bgpd/rfapi/rfapi_import.c
index b6d32d36e..583adcda7 100644
--- a/bgpd/rfapi/rfapi_import.c
+++ b/bgpd/rfapi/rfapi_import.c
@@ -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)
diff --git a/lib/vty.c b/lib/vty.c
index 639307b50..e306e69b8 100644
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -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) {
diff --git a/nhrpd/vici.c b/nhrpd/vici.c
index 3de4609a2..d6105b71d 100644
--- a/nhrpd/vici.c
+++ b/nhrpd/vici.c
@@ -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));
diff --git a/ripngd/ripng_interface.c b/ripngd/ripng_interface.c
index 5a4087b17..d83f4d279 100644
--- a/ripngd/ripng_interface.c
+++ b/ripngd/ripng_interface.c
@@ -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;
}