summaryrefslogtreecommitdiffstats
path: root/ospf6d/ospf6_bfd.c
diff options
context:
space:
mode:
authorradhika <radhika@cumulusnetworks.com>2015-10-09 22:44:32 +0200
committerradhika <radhika@cumulusnetworks.com>2015-10-09 22:44:32 +0200
commit1eab5b17bc6462ea9381a0fd32c0f0317fe51bd3 (patch)
tree4a9d2226ee5aab4e5052cd25f0ca6e9223ac0e27 /ospf6d/ospf6_bfd.c
parent Fix Quagga ptm status per interface to show more meaningful status (diff)
downloadfrr-1eab5b17bc6462ea9381a0fd32c0f0317fe51bd3.tar.xz
frr-1eab5b17bc6462ea9381a0fd32c0f0317fe51bd3.zip
Fix for IPv6 OSPF BFD session staying down when ifdown/ifup on logical interfaces
Ticket: CM-7649 Reviewed By: Donald Testing Done: This is porting of the patch, ospf6d-bfd-fix-dereg-miss.patch from br2.5. Issue: The IPv6 OSPF BFD sessions stay down after ifdown/ifup on logical interfaces. This problem doesn’t exist for BFD sessions created by BGP and IPv4 OSPF. Root cause: When the interface is brought down the IPv6 neighbors discovered on that interface are deleted. This deletion happens without first bringing down the neighbor and the BFD deregistration happens only when the neighbor state changes. This leaves an orphaned BFD session in PTM. Also, the BFD session socket that is bound to the interface that was brought down loses connection. The socket has to be rebound to the interface when it comes up. This problem will not happen if the client deleted the sessions and re-adds it when interface goes down and come up. IPv4 OSPF and BGP work exactly like that. Fix: Added the BFD deregistration code to IPv6 OSPF neighbor delete.
Diffstat (limited to 'ospf6d/ospf6_bfd.c')
-rw-r--r--ospf6d/ospf6_bfd.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/ospf6d/ospf6_bfd.c b/ospf6d/ospf6_bfd.c
index 5ef4ab4ca..16dedb103 100644
--- a/ospf6d/ospf6_bfd.c
+++ b/ospf6d/ospf6_bfd.c
@@ -71,7 +71,7 @@ ospf6_bfd_show_info(struct vty *vty, void *bfd_info, int param_only)
* zebra for starting/stopping the monitoring of
* the neighbor rechahability.
*/
-static void
+void
ospf6_bfd_reg_dereg_nbr (struct ospf6_neighbor *on, int command)
{
struct ospf6_interface *oi = on->ospf6_if;
@@ -79,7 +79,7 @@ ospf6_bfd_reg_dereg_nbr (struct ospf6_neighbor *on, int command)
struct bfd_info *bfd_info;
char src[64];
- if (!oi->bfd_info)
+ if (!oi->bfd_info || !on->bfd_info)
return;
bfd_info = (struct bfd_info *)oi->bfd_info;
@@ -93,6 +93,9 @@ ospf6_bfd_reg_dereg_nbr (struct ospf6_neighbor *on, int command)
bfd_peer_sendmsg (zclient, bfd_info, AF_INET6, &on->linklocal_addr,
on->ospf6_if->linklocal_addr, ifp->name,
0, 0, command, 0);
+
+ if (command == ZEBRA_BFD_DEST_DEREGISTER)
+ bfd_info_free((struct bfd_info **)&on->bfd_info);
}
/*
@@ -123,14 +126,16 @@ ospf6_bfd_reg_dereg_all_nbr (struct ospf6_interface *oi, int command)
for (ALL_LIST_ELEMENTS_RO (oi->neighbor_list, node, on))
{
- if (command != ZEBRA_BFD_DEST_DEREGISTER)
+ if (command == ZEBRA_BFD_DEST_REGISTER)
ospf6_bfd_info_nbr_create(oi, on);
- else
- bfd_info_free((struct bfd_info **)&on->bfd_info);
if (on->state < OSPF6_NEIGHBOR_TWOWAY)
- continue;
-
+ {
+ if (command == ZEBRA_BFD_DEST_DEREGISTER)
+ bfd_info_free((struct bfd_info **)&on->bfd_info);
+ continue;
+ }
+
ospf6_bfd_reg_dereg_nbr(on, command);
}
}