diff options
| author | anuradhak <anuradhak@cumulusnetworks.com> | 2016-11-18 09:12:27 -0800 |
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2016-12-21 20:26:16 -0500 |
| commit | 7176984f745f73c1350b69100295b25824d20dd4 (patch) | |
| tree | 56a938670f28efb2428d03d26dad82c4878aa810 /pimd/pim_msdp.c | |
| parent | 55a645a636fbfcd0920775933cd3bb9e51660d4f (diff) | |
pim-anycast-rp: Add limited support for secondary addresses.
Anycast requires that the lo interface be associated with multiple
addresses. One is the anycast IP address (which is the same on all RPs
participating in RP redundancy) and the second is the unique IP address
that will be used as the router id by routing protocols.
To accomodate that we maintain a list of secondary addresses per-pim iface
and allow any of them to be the RP address. This lets the I_am_RP macro
succeed on anycast RPs.
Note that the support is limited i.e. we don't actually advertise a
secondary list to the neighbors. This is assuming the anycast IP will never
be used as a router id i.e. will never be an RPF neighbor.
Sample output:
==============
dell-s6000-04# sh ip pim interface lo
Interface : lo
State : up
Address : 100.1.1.1 (primary)
100.1.1.2
100.1.1.3
100.1.2.1
>>>>>>> SNIP >>>>>>>>>>>>>>>
dell-s6000-04# sh ip pim interface lo json
{
"lo":{
"name":"lo",
"state":"up",
"address":"100.1.1.1",
"index":1,
"lanDelayEnabled":true,
"secondaryAddressList":[
"100.1.1.2",
"100.1.1.3",
"100.1.2.1"
],
>>>>>>> SNIP >>>>>>>>>>>>>>>
dell-s6000-04#sh ip pim rp-info
RP address group/prefix-list OIF I am RP
100.1.2.1 224.0.0.0/4 lo yes
dell-s6000-04#
Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'pimd/pim_msdp.c')
| -rw-r--r-- | pimd/pim_msdp.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/pimd/pim_msdp.c b/pimd/pim_msdp.c index bee5e734db..e10289e90c 100644 --- a/pimd/pim_msdp.c +++ b/pimd/pim_msdp.c @@ -33,6 +33,7 @@ #include "pimd.h" #include "pim_cmd.h" #include "pim_memory.h" +#include "pim_iface.h" #include "pim_rp.h" #include "pim_str.h" #include "pim_time.h" @@ -526,6 +527,7 @@ void pim_msdp_i_am_rp_changed(void) { struct listnode *sanode; + struct listnode *nextnode; struct pim_msdp_sa *sa; if (!(msdp->flags & PIM_MSDPF_ENABLE)) { @@ -547,16 +549,18 @@ pim_msdp_i_am_rp_changed(void) /* re-setup local SA entries */ pim_msdp_sa_local_setup(); - for (ALL_LIST_ELEMENTS_RO(msdp->sa_list, sanode, sa)) { + for (ALL_LIST_ELEMENTS(msdp->sa_list, sanode, nextnode, sa)) { /* purge stale SA entries */ if (sa->flags & PIM_MSDP_SAF_STALE) { /* clear the stale flag; the entry may be kept even after * "local-deref" */ sa->flags &= ~PIM_MSDP_SAF_STALE; + /* sa_deref can end up freeing the sa; so don't access contents after */ pim_msdp_sa_deref(sa, PIM_MSDP_SAF_LOCAL); + } else { + /* if the souce is still active check if we can influence SPT */ + pim_msdp_sa_upstream_update(sa, NULL /* xg_up */, "rp-change"); } - /* also check if we can still influence SPT */ - pim_msdp_sa_upstream_update(sa, NULL /* xg_up */, "rp-change"); } } @@ -1216,6 +1220,8 @@ pim_msdp_mg_free(struct pim_msdp_mg *mg) XFREE(MTYPE_PIM_MSDP_MG_NAME, mg->mesh_group_name); XFREE(MTYPE_PIM_MSDP_MG, mg); + if (mg->mbr_list) + list_free(mg->mbr_list); msdp->mg = NULL; } @@ -1536,10 +1542,6 @@ pim_msdp_enable(void) void pim_msdp_init(struct thread_master *master) { - /* XXX: temporarily enable noisy logs; will be disabled once dev is - * complete */ - PIM_DO_DEBUG_MSDP_INTERNAL; - msdp->master = master; msdp->peer_hash = hash_create(pim_msdp_peer_hash_key_make, |
