summaryrefslogtreecommitdiff
path: root/zebra/zebra_ptm.h
diff options
context:
space:
mode:
authorradhika <radhika@cumulusnetworks.com>2016-06-21 03:39:58 -0700
committerradhika <radhika@cumulusnetworks.com>2016-06-21 03:39:58 -0700
commit2376c3f225ee601e2e025e1813006ab79c3fd0a6 (patch)
tree6bab931635afa55ebeacc2e716e1055409d301b8 /zebra/zebra_ptm.h
parent6776485deef32900c119a61d43faecb515d3b20b (diff)
bfd: Fix for missing BFD client regs/deregs from quagga clients
Ticket: CM-11256 Signed-off-by: Radhika Mahankali <radhika@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com> Reviewed-by: Kanna Rajagopal <kanna@cumulusnetworks.com> Testing: Unit, PTM smoke, OSPF smoke, BGP Smoke Issue: BFD client registrations are not being sent to PTM from BGP/OSPF clients when the quagga clients have no BFD configuration. This can create stale BFD sessions in PTM when BFD is removed from quagga configuration before quagga is restarted. BFD client de-registrations from BGP/OSPF also go missing sometimes when quagga is restarted. This also will cause stale BFD sessions in PTM. Root Cause: BFD client registrations were being sent at the time of BGP/OSPF daemon initialization. But, they were being sent to zebra before the socket connection between zebra and BGP/OSPF was established. This causes the missing BFD client registrations. BFD client de-registrations are sent from zebra when zebra detects socket close for BGP/OSPF daemons. Based on the timing, the de-registrations may happen after socket between PTM and zebra is closed. This will result in missing de-registrations. Fix: Moved sending of BFD client registration messages to zebra connected callback to make sure that they are sent after the BGP/OSPF daemons connect with zebra. Added BFD client de-registrations for BGP/OSPF to be also sent when zebra daemon gets restart signal. They are sent from the signal handler only if it was not already handled in zebra client socket close callback.
Diffstat (limited to 'zebra/zebra_ptm.h')
-rw-r--r--zebra/zebra_ptm.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/zebra/zebra_ptm.h b/zebra/zebra_ptm.h
index 27c0e42f99..71c85d9094 100644
--- a/zebra/zebra_ptm.h
+++ b/zebra/zebra_ptm.h
@@ -27,6 +27,8 @@ extern const char ZEBRA_PTM_SOCK_NAME[];
#define ZEBRA_PTM_MAX_SOCKBUF 3200 /* 25B *128 ports */
#define ZEBRA_PTM_SEND_MAX_SOCKBUF 512
+#define ZEBRA_PTM_BFD_CLIENT_FLAG_REG (1 << 1) /* client registered with BFD */
+
/* Zebra ptm context block */
struct zebra_ptm_cb
{
@@ -44,6 +46,7 @@ struct zebra_ptm_cb
int ptm_enable;
int pid;
+ u_int8_t client_flags[ZEBRA_ROUTE_MAX];
};
#define ZEBRA_PTM_STATUS_DOWN 0
@@ -72,5 +75,5 @@ int zebra_ptm_bfd_client_register (struct zserv *client, int sock,
void zebra_ptm_if_init(struct zebra_if *zebra_ifp);
void zebra_ptm_if_set_ptm_state(struct interface *ifp, struct zebra_if *zebra_ifp);
void zebra_ptm_if_write (struct vty *vty, struct zebra_if *zebra_ifp);
-void zebra_ptm_bfd_client_deregister (struct zserv *client);
+void zebra_ptm_bfd_client_deregister (int proto);
#endif