summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nhrpd/nhrp_peer.c5
-rw-r--r--pimd/pim_iface.c15
2 files changed, 16 insertions, 4 deletions
diff --git a/nhrpd/nhrp_peer.c b/nhrpd/nhrp_peer.c
index fa11980c18..97932795a3 100644
--- a/nhrpd/nhrp_peer.c
+++ b/nhrpd/nhrp_peer.c
@@ -1355,6 +1355,11 @@ void nhrp_peer_recv(struct nhrp_peer *p, struct zbuf *zb)
}
break;
case NHRP_ROUTE_NBMA_NEXTHOP:
+ if (hdr->hop_count == 0) {
+ nhrp_packet_send_error(&pp, NHRP_ERROR_HOP_COUNT_EXCEEDED, 0);
+ info = "hop count exceeded";
+ goto drop;
+ }
nhrp_peer_forward(peer, &pp);
break;
case NHRP_ROUTE_BLACKHOLE:
diff --git a/pimd/pim_iface.c b/pimd/pim_iface.c
index 2642316c7d..33c03464e4 100644
--- a/pimd/pim_iface.c
+++ b/pimd/pim_iface.c
@@ -192,8 +192,17 @@ void pim_if_delete(struct interface *ifp)
assert(pim_ifp);
pim_ifp->pim->mcast_if_count--;
- if (pim_ifp->gm_join_list)
+ if (pim_ifp->gm_join_list) {
pim_if_gm_join_del_all(ifp);
+ /*
+ * Sometimes gm_join_del_all does not delete them all
+ * and as such it's not actually freed. Let's
+ * just clean this up if it wasn't to prevent
+ * the problem.
+ */
+ if (pim_ifp->gm_join_list)
+ list_delete(&pim_ifp->gm_join_list);
+ }
if (pim_ifp->static_group_list)
pim_if_static_group_del_all(ifp);
@@ -1439,10 +1448,8 @@ int pim_if_gm_join_del(struct interface *ifp, pim_addr group_addr,
}
listnode_delete(pim_ifp->gm_join_list, ij);
gm_join_free(ij);
- if (listcount(pim_ifp->gm_join_list) < 1) {
+ if (listcount(pim_ifp->gm_join_list) < 1)
list_delete(&pim_ifp->gm_join_list);
- pim_ifp->gm_join_list = 0;
- }
return 0;
}