From ce2b6ce0984a6a0c7dbfccafeb1b440128f5c878 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Thu, 16 Mar 2017 11:15:32 -0400 Subject: [PATCH] pimd: Consider interface change a RPF_CHANGED event Suppose you have a unnumbered ecmp connections between two switches: st1-l3# show ip pim neighbor Interface Neighbor Uptime Holdtime DR Pri swp52 6.0.0.10 00:00:01 00:00:29 1 swp53 6.0.0.10 00:00:06 00:00:26 1 And for a given (S,G) the RPF goes: st1-l3# show ip nht 99.1.1.1 resolved via bgp fe80::4e76:25ff:fee7:42d1, via swp52 fe80::4e76:25ff:fee7:42d5, via swp53 Client list: pim(fd 14) Now suppose, 52 is the choosen RPF( since we can only pick one ) and the interface goes down. As such we will choose to use swp53. The problem was that the pim_rpf_update call is made it will change the rpf interface to 53, but not tell the calling function that the RPF_CHANGED because it is only looking at the rpf_addr(the nexthop) to see if it is changed and if we are in an unnumbered dual ecmp to the same box it was not detecting and notifying. Signed-off-by: Donald Sharp --- pimd/pim_rpf.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pimd/pim_rpf.c b/pimd/pim_rpf.c index 3d278f12a7..180586a786 100644 --- a/pimd/pim_rpf.c +++ b/pimd/pim_rpf.c @@ -263,7 +263,9 @@ enum pim_rpf_result pim_rpf_update(struct pim_upstream *up, struct pim_rpf *old, } /* detect change in RPF'(S,G) */ - if (saved.rpf_addr.u.prefix4.s_addr != rpf->rpf_addr.u.prefix4.s_addr) { + if (saved.rpf_addr.u.prefix4.s_addr != rpf->rpf_addr.u.prefix4.s_addr || + saved.source_nexthop.interface != rpf->source_nexthop.interface) + { /* return old rpf to caller ? */ if (old) -- 2.39.5