summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md2
-rw-r--r--bgpd/bgp_bmp.c2
-rw-r--r--bgpd/bgp_route.c72
-rw-r--r--lib/log.c2
-rw-r--r--lib/subdir.am5
-rw-r--r--lib/vty.c1
-rw-r--r--pimd/pim_ssmpingd.c10
-rw-r--r--pimd/pim_vty.c2
-rw-r--r--zebra/if_netlink.c4
-rw-r--r--zebra/interface.c5
-rw-r--r--zebra/interface.h2
-rw-r--r--zebra/ioctl.c8
-rw-r--r--zebra/kernel_socket.c35
-rw-r--r--zebra/zebra_netns_notify.c2
14 files changed, 91 insertions, 61 deletions
diff --git a/README.md b/README.md
index 0724dae335..600a91e386 100644
--- a/README.md
+++ b/README.md
@@ -59,7 +59,7 @@ lists:
For chat, we currently use [Slack](https://frrouting.slack.com). You can join
by clicking the "Slack" link under the
-[Participate](https://frrouting.org/#participate) section of our website.
+[Participate](https://frrouting.org/community) section of our website.
Contributing
diff --git a/bgpd/bgp_bmp.c b/bgpd/bgp_bmp.c
index 96c34f9196..39158f0147 100644
--- a/bgpd/bgp_bmp.c
+++ b/bgpd/bgp_bmp.c
@@ -1619,6 +1619,8 @@ static void bmp_targets_put(struct bmp_targets *bt)
struct bmp *bmp;
struct bmp_active *ba;
+ THREAD_OFF(bt->t_stats);
+
frr_each_safe (bmp_actives, &bt->actives, ba)
bmp_active_put(ba);
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index 78e4964d9f..3abfa7ebcf 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -13961,6 +13961,8 @@ DEFPY (show_ip_bgp_instance_neighbor_advertised_route,
int idx = 0;
bool first = true;
uint16_t show_flags = 0;
+ struct listnode *node;
+ struct bgp *abgp;
if (uj) {
argc--;
@@ -14012,42 +14014,52 @@ DEFPY (show_ip_bgp_instance_neighbor_advertised_route,
|| CHECK_FLAG(show_flags, BGP_SHOW_OPT_AFI_IP6)) {
afi = CHECK_FLAG(show_flags, BGP_SHOW_OPT_AFI_IP) ? AFI_IP
: AFI_IP6;
- FOREACH_SAFI (safi) {
- if (!bgp_afi_safi_peer_exists(bgp, afi, safi))
- continue;
+ for (ALL_LIST_ELEMENTS_RO(bm->bgp, node, abgp)) {
+ FOREACH_SAFI (safi) {
+ if (!bgp_afi_safi_peer_exists(abgp, afi, safi))
+ continue;
- if (uj) {
- if (first)
- first = false;
- else
- vty_out(vty, ",\n");
- vty_out(vty, "\"%s\":",
- get_afi_safi_str(afi, safi, true));
- } else
- vty_out(vty, "\nFor address family: %s\n",
- get_afi_safi_str(afi, safi, false));
+ if (uj) {
+ if (first)
+ first = false;
+ else
+ vty_out(vty, ",\n");
+ vty_out(vty, "\"%s\":",
+ get_afi_safi_str(afi, safi,
+ true));
+ } else
+ vty_out(vty,
+ "\nFor address family: %s\n",
+ get_afi_safi_str(afi, safi,
+ false));
- peer_adj_routes(vty, peer, afi, safi, type, rmap_name,
- show_flags);
+ peer_adj_routes(vty, peer, afi, safi, type,
+ rmap_name, show_flags);
+ }
}
} else {
- FOREACH_AFI_SAFI (afi, safi) {
- if (!bgp_afi_safi_peer_exists(bgp, afi, safi))
- continue;
+ for (ALL_LIST_ELEMENTS_RO(bm->bgp, node, abgp)) {
+ FOREACH_AFI_SAFI (afi, safi) {
+ if (!bgp_afi_safi_peer_exists(abgp, afi, safi))
+ continue;
- if (uj) {
- if (first)
- first = false;
- else
- vty_out(vty, ",\n");
- vty_out(vty, "\"%s\":",
- get_afi_safi_str(afi, safi, true));
- } else
- vty_out(vty, "\nFor address family: %s\n",
- get_afi_safi_str(afi, safi, false));
+ if (uj) {
+ if (first)
+ first = false;
+ else
+ vty_out(vty, ",\n");
+ vty_out(vty, "\"%s\":",
+ get_afi_safi_str(afi, safi,
+ true));
+ } else
+ vty_out(vty,
+ "\nFor address family: %s\n",
+ get_afi_safi_str(afi, safi,
+ false));
- peer_adj_routes(vty, peer, afi, safi, type, rmap_name,
- show_flags);
+ peer_adj_routes(vty, peer, afi, safi, type,
+ rmap_name, show_flags);
+ }
}
}
if (uj)
diff --git a/lib/log.c b/lib/log.c
index fb12c08aae..5c453569ee 100644
--- a/lib/log.c
+++ b/lib/log.c
@@ -239,7 +239,7 @@ void zlog_backtrace(int priority)
{
#ifdef HAVE_LIBUNWIND
char buf[100];
- unw_cursor_t cursor;
+ unw_cursor_t cursor = {};
unw_context_t uc;
unw_word_t ip, off, sp;
Dl_info dlinfo;
diff --git a/lib/subdir.am b/lib/subdir.am
index b505e235ca..d1df9cb3d9 100644
--- a/lib/subdir.am
+++ b/lib/subdir.am
@@ -523,6 +523,11 @@ lib/clippy-command_parse.$(OBJEXT): lib/command_lex.h
lib/lib_clippy-command_lex.$(OBJEXT): lib/command_parse.h
lib/lib_clippy-command_parse.$(OBJEXT): lib/command_lex.h
+DISTCLEANFILES += lib/command_lex.h \
+ lib/command_lex.c \
+ lib/command_parse.h \
+ lib/command_parse.c
+
rt_enabled =
if BABELD
diff --git a/lib/vty.c b/lib/vty.c
index 78ef9894de..619d51e1ce 100644
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -2033,6 +2033,7 @@ static int vtysh_do_pass_fd(struct vty *vty)
struct cmsghdr *cmh = CMSG_FIRSTHDR(&mh);
ssize_t ret;
+ memset(&u.buf, 0, sizeof(u.buf));
cmh->cmsg_level = SOL_SOCKET;
cmh->cmsg_type = SCM_RIGHTS;
cmh->cmsg_len = CMSG_LEN(sizeof(int));
diff --git a/pimd/pim_ssmpingd.c b/pimd/pim_ssmpingd.c
index da903bd980..afa7e37da1 100644
--- a/pimd/pim_ssmpingd.c
+++ b/pimd/pim_ssmpingd.c
@@ -212,7 +212,7 @@ static void ssmpingd_delete(struct ssmpingd_sock *ss)
if (close(ss->sock_fd)) {
zlog_warn(
- "%s: failure closing ssmpingd sock_fd=%d for source %pI4: errno=%d: %s",
+ "%s: failure closing ssmpingd sock_fd=%d for source %pPA: errno=%d: %s",
__func__, ss->sock_fd, &ss->source_addr, errno,
safe_strerror(errno));
/* warning only */
@@ -262,7 +262,7 @@ static int ssmpingd_read_msg(struct ssmpingd_sock *ss)
if (len < 0) {
zlog_warn(
- "%s: failure receiving ssmping for source %pI4 on fd=%d: errno=%d: %s",
+ "%s: failure receiving ssmping for source %pPA on fd=%d: errno=%d: %s",
__func__, &ss->source_addr, ss->sock_fd, errno,
safe_strerror(errno));
return -1;
@@ -272,7 +272,7 @@ static int ssmpingd_read_msg(struct ssmpingd_sock *ss)
if (buf[0] != PIM_SSMPINGD_REQUEST) {
zlog_warn(
- "%s: bad ssmping type=%d from %pSUp to %pSUp on interface %s ifindex=%d fd=%d src=%pI4",
+ "%s: bad ssmping type=%d from %pSUp to %pSUp on interface %s ifindex=%d fd=%d src=%pPA",
__func__, buf[0], &from, &to,
ifp ? ifp->name : "<iface?>", ifindex, ss->sock_fd,
&ss->source_addr);
@@ -281,7 +281,7 @@ static int ssmpingd_read_msg(struct ssmpingd_sock *ss)
if (PIM_DEBUG_SSMPINGD) {
zlog_debug(
- "%s: recv ssmping from %pSUp, to %pSUp, on interface %s ifindex=%d fd=%d src=%pI4",
+ "%s: recv ssmping from %pSUp, to %pSUp, on interface %s ifindex=%d fd=%d src=%pPA",
__func__, &from, &to, ifp ? ifp->name : "<iface?>",
ifindex, ss->sock_fd, &ss->source_addr);
}
@@ -330,7 +330,7 @@ static struct ssmpingd_sock *ssmpingd_new(struct pim_instance *pim,
sock_fd =
ssmpingd_socket(source_addr, /* port: */ 4321, /* mTTL: */ 64);
if (sock_fd < 0) {
- zlog_warn("%s: ssmpingd_socket() failure for source %pI4",
+ zlog_warn("%s: ssmpingd_socket() failure for source %pPA",
__func__, &source_addr);
return 0;
}
diff --git a/pimd/pim_vty.c b/pimd/pim_vty.c
index a7d5986655..a0dea63b79 100644
--- a/pimd/pim_vty.c
+++ b/pimd/pim_vty.c
@@ -264,7 +264,7 @@ int pim_global_config_write_worker(struct pim_instance *pim, struct vty *vty)
struct ssmpingd_sock *ss;
++writes;
for (ALL_LIST_ELEMENTS_RO(pim->ssmpingd_list, node, ss)) {
- vty_out(vty, "%sip ssmpingd %pI4\n", spaces,
+ vty_out(vty, "%sip ssmpingd %pPA\n", spaces,
&ss->source_addr);
++writes;
}
diff --git a/zebra/if_netlink.c b/zebra/if_netlink.c
index fca03e55bf..873aea236d 100644
--- a/zebra/if_netlink.c
+++ b/zebra/if_netlink.c
@@ -103,7 +103,7 @@ static void set_ifindex(struct interface *ifp, ifindex_t ifi_index,
EC_LIB_INTERFACE,
"interface rename detected on up interface: index %d was renamed from %s to %s, results are uncertain!",
ifi_index, oifp->name, ifp->name);
- if_delete_update(oifp);
+ if_delete_update(&oifp);
}
}
if_set_index(ifp, ifi_index);
@@ -2144,7 +2144,7 @@ int netlink_link_change(struct nlmsghdr *h, ns_id_t ns_id, int startup)
else if (IS_ZEBRA_IF_VXLAN(ifp))
zebra_l2_vxlanif_del(ifp);
- if_delete_update(ifp);
+ if_delete_update(&ifp);
/* If VRF, delete the VRF structure itself. */
if (zif_type == ZEBRA_IF_VRF && !vrf_is_backend_netns())
diff --git a/zebra/interface.c b/zebra/interface.c
index 69d611e583..a70326ebb3 100644
--- a/zebra/interface.c
+++ b/zebra/interface.c
@@ -806,9 +806,10 @@ static void if_delete_connected(struct interface *ifp)
}
/* Handle an interface delete event */
-void if_delete_update(struct interface *ifp)
+void if_delete_update(struct interface **pifp)
{
struct zebra_if *zif;
+ struct interface *ifp = *pifp;
if (if_is_up(ifp)) {
flog_err(
@@ -871,7 +872,7 @@ void if_delete_update(struct interface *ifp)
if (IS_ZEBRA_DEBUG_KERNEL)
zlog_debug("interface %s is being deleted from the system",
ifp->name);
- if_delete(&ifp);
+ if_delete(pifp);
}
}
diff --git a/zebra/interface.h b/zebra/interface.h
index 4b06603e7f..c6930ce816 100644
--- a/zebra/interface.h
+++ b/zebra/interface.h
@@ -492,7 +492,7 @@ extern void if_nbr_ipv6ll_to_ipv4ll_neigh_update(struct interface *ifp,
struct in6_addr *address,
int add);
extern void if_nbr_ipv6ll_to_ipv4ll_neigh_del_all(struct interface *ifp);
-extern void if_delete_update(struct interface *ifp);
+extern void if_delete_update(struct interface **ifp);
extern void if_add_update(struct interface *ifp);
extern void if_up(struct interface *ifp, bool install_connected);
extern void if_down(struct interface *);
diff --git a/zebra/ioctl.c b/zebra/ioctl.c
index 9b6aaf1d85..a895ed9410 100644
--- a/zebra/ioctl.c
+++ b/zebra/ioctl.c
@@ -136,7 +136,7 @@ static int if_ioctl_ipv6(unsigned long request, caddr_t buffer)
void if_get_metric(struct interface *ifp)
{
#ifdef SIOCGIFMETRIC
- struct ifreq ifreq;
+ struct ifreq ifreq = {};
ifreq_set_name(&ifreq, ifp);
@@ -153,7 +153,7 @@ void if_get_metric(struct interface *ifp)
/* get interface MTU */
void if_get_mtu(struct interface *ifp)
{
- struct ifreq ifreq;
+ struct ifreq ifreq = {};
ifreq_set_name(&ifreq, ifp);
@@ -410,8 +410,8 @@ int if_unset_prefix_ctx(const struct zebra_dplane_ctx *ctx)
void if_get_flags(struct interface *ifp)
{
int ret;
- struct ifreq ifreqflags;
- struct ifreq ifreqdata;
+ struct ifreq ifreqflags = {};
+ struct ifreq ifreqdata = {};
ifreq_set_name(&ifreqflags, ifp);
ifreq_set_name(&ifreqdata, ifp);
diff --git a/zebra/kernel_socket.c b/zebra/kernel_socket.c
index 6583af0a54..d6ca92f54e 100644
--- a/zebra/kernel_socket.c
+++ b/zebra/kernel_socket.c
@@ -159,6 +159,9 @@ const struct message rtm_type_str[] = {{RTM_ADD, "RTM_ADD"},
#ifdef RTM_IFANNOUNCE
{RTM_IFANNOUNCE, "RTM_IFANNOUNCE"},
#endif /* RTM_IFANNOUNCE */
+#ifdef RTM_IEEE80211
+ {RTM_IEEE80211, "RTM_IEEE80211"},
+#endif
{0}};
static const struct message rtm_flag_str[] = {{RTF_UP, "UP"},
@@ -450,12 +453,13 @@ static int ifan_read(struct if_announcemsghdr *ifan)
if_get_metric(ifp);
if_add_update(ifp);
} else if (ifp != NULL && ifan->ifan_what == IFAN_DEPARTURE)
- if_delete_update(ifp);
-
- if_get_flags(ifp);
- if_get_mtu(ifp);
- if_get_metric(ifp);
+ if_delete_update(&ifp);
+ if (ifp) {
+ if_get_flags(ifp);
+ if_get_mtu(ifp);
+ if_get_metric(ifp);
+ }
if (IS_ZEBRA_DEBUG_KERNEL)
zlog_debug("%s: interface %s index %d", __func__,
ifan->ifan_name, ifan->ifan_index);
@@ -722,10 +726,10 @@ int ifm_read(struct if_msghdr *ifm)
* will still behave correctly if run on a platform
* without
*/
- if_delete_update(ifp);
+ if_delete_update(&ifp);
}
#endif /* RTM_IFANNOUNCE */
- if (if_is_up(ifp)) {
+ if (ifp && if_is_up(ifp)) {
#if defined(__bsdi__)
if_kvm_get_mtu(ifp);
#else
@@ -735,14 +739,16 @@ int ifm_read(struct if_msghdr *ifm)
}
}
+ if (ifp) {
#ifdef HAVE_NET_RT_IFLIST
- ifp->stats = ifm->ifm_data;
+ ifp->stats = ifm->ifm_data;
#endif /* HAVE_NET_RT_IFLIST */
- ifp->speed = ifm->ifm_data.ifi_baudrate / 1000000;
+ ifp->speed = ifm->ifm_data.ifi_baudrate / 1000000;
- if (IS_ZEBRA_DEBUG_KERNEL)
- zlog_debug("%s: interface %s index %d", __func__, ifp->name,
- ifp->ifindex);
+ if (IS_ZEBRA_DEBUG_KERNEL)
+ zlog_debug("%s: interface %s index %d", __func__,
+ ifp->name, ifp->ifindex);
+ }
return 0;
}
@@ -1405,7 +1411,10 @@ static void kernel_read(struct thread *thread)
#endif /* RTM_IFANNOUNCE */
default:
if (IS_ZEBRA_DEBUG_KERNEL)
- zlog_debug("Unprocessed RTM_type: %d", rtm->rtm_type);
+ zlog_debug(
+ "Unprocessed RTM_type: %s(%d)",
+ lookup_msg(rtm_type_str, rtm->rtm_type, NULL),
+ rtm->rtm_type);
break;
}
}
diff --git a/zebra/zebra_netns_notify.c b/zebra/zebra_netns_notify.c
index 7cb1906895..af6046c9ad 100644
--- a/zebra/zebra_netns_notify.c
+++ b/zebra/zebra_netns_notify.c
@@ -179,7 +179,7 @@ static int zebra_ns_delete(char *name)
}
UNSET_FLAG(ifp->flags, IFF_UP);
- if_delete_update(ifp);
+ if_delete_update(&ifp);
}
ns = (struct ns *)vrf->ns_ctxt;