summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bgpd/bgp_open.c14
-rw-r--r--mgmtd/mgmt_history.c1
-rw-r--r--ospfd/ospf_lsa.c16
-rw-r--r--pimd/pim_zebra.c12
4 files changed, 34 insertions, 9 deletions
diff --git a/bgpd/bgp_open.c b/bgpd/bgp_open.c
index 032767820f..4814d69c33 100644
--- a/bgpd/bgp_open.c
+++ b/bgpd/bgp_open.c
@@ -604,12 +604,24 @@ static int bgp_capability_restart(struct peer *peer,
static int bgp_capability_llgr(struct peer *peer,
struct capability_header *caphdr)
{
+/*
+ * +--------------------------------------------------+
+ * | Address Family Identifier (16 bits) |
+ * +--------------------------------------------------+
+ * | Subsequent Address Family Identifier (8 bits) |
+ * +--------------------------------------------------+
+ * | Flags for Address Family (8 bits) |
+ * +--------------------------------------------------+
+ * | Long-lived Stale Time (24 bits) |
+ * +--------------------------------------------------+
+ */
+#define BGP_CAP_LLGR_MIN_PACKET_LEN 7
struct stream *s = BGP_INPUT(peer);
size_t end = stream_get_getp(s) + caphdr->length;
SET_FLAG(peer->cap, PEER_CAP_LLGR_RCV);
- while (stream_get_getp(s) + 4 <= end) {
+ while (stream_get_getp(s) + BGP_CAP_LLGR_MIN_PACKET_LEN <= end) {
afi_t afi;
safi_t safi;
iana_afi_t pkt_afi = stream_getw(s);
diff --git a/mgmtd/mgmt_history.c b/mgmtd/mgmt_history.c
index 75def3a05e..0e664bc0f1 100644
--- a/mgmtd/mgmt_history.c
+++ b/mgmtd/mgmt_history.c
@@ -143,6 +143,7 @@ static bool mgmt_history_read_cmt_record_index(void)
} else {
zlog_err("More records found in index file %s",
MGMTD_COMMIT_INDEX_FILE_NAME);
+ fclose(fp);
return false;
}
diff --git a/ospfd/ospf_lsa.c b/ospfd/ospf_lsa.c
index da014bd02b..8b34ce6d76 100644
--- a/ospfd/ospf_lsa.c
+++ b/ospfd/ospf_lsa.c
@@ -1290,7 +1290,7 @@ static struct ospf_lsa *ospf_handle_summarylsa_lsId_chg(struct ospf_area *area,
struct in_addr old_id)
{
struct ospf_lsa *lsa = NULL;
- struct ospf_lsa *new = NULL;
+ struct ospf_lsa *summary_lsa = NULL;
struct summary_lsa *sl = NULL;
struct ospf_area *old_area = NULL;
struct ospf *ospf = area->ospf;
@@ -1328,19 +1328,19 @@ static struct ospf_lsa *ospf_handle_summarylsa_lsId_chg(struct ospf_area *area,
if (type == OSPF_SUMMARY_LSA) {
/*Refresh the LSA with new LSA*/
- ospf_summary_lsa_refresh(ospf, lsa);
+ summary_lsa = ospf_summary_lsa_refresh(ospf, lsa);
- new = ospf_summary_lsa_prepare_and_flood(
- &old_prefix, old_metric, old_area, old_id);
+ ospf_summary_lsa_prepare_and_flood(&old_prefix, old_metric,
+ old_area, old_id);
} else {
/*Refresh the LSA with new LSA*/
- ospf_summary_asbr_lsa_refresh(ospf, lsa);
+ summary_lsa = ospf_summary_asbr_lsa_refresh(ospf, lsa);
- new = ospf_asbr_summary_lsa_prepare_and_flood(
- &old_prefix, old_metric, old_area, old_id);
+ ospf_asbr_summary_lsa_prepare_and_flood(&old_prefix, old_metric,
+ old_area, old_id);
}
- return new;
+ return summary_lsa;
}
/* Originate Summary-LSA. */
diff --git a/pimd/pim_zebra.c b/pimd/pim_zebra.c
index 29aac7f1c7..f4e3032867 100644
--- a/pimd/pim_zebra.c
+++ b/pimd/pim_zebra.c
@@ -55,6 +55,8 @@ static int pim_zebra_interface_vrf_update(ZAPI_CALLBACK_ARGS)
{
struct interface *ifp;
vrf_id_t new_vrf_id;
+ struct pim_instance *pim;
+ struct pim_interface *pim_ifp;
ifp = zebra_interface_vrf_update_read(zclient->ibuf, vrf_id,
&new_vrf_id);
@@ -65,8 +67,18 @@ static int pim_zebra_interface_vrf_update(ZAPI_CALLBACK_ARGS)
zlog_debug("%s: %s updating from %u to %u", __func__, ifp->name,
vrf_id, new_vrf_id);
+ pim = pim_get_pim_instance(new_vrf_id);
+
if_update_to_new_vrf(ifp, new_vrf_id);
+ pim_ifp = ifp->info;
+ if (!pim_ifp)
+ return 0;
+
+ pim_ifp->pim->mcast_if_count--;
+ pim_ifp->pim = pim;
+ pim_ifp->pim->mcast_if_count++;
+
return 0;
}