summaryrefslogtreecommitdiff
path: root/lib/bfd.c
diff options
context:
space:
mode:
authorPhilippe Guibert <philippe.guibert@6wind.com>2019-04-15 17:20:25 +0200
committerPhilippe Guibert <philippe.guibert@6wind.com>2019-05-14 16:49:49 +0200
commit9beff0bda93a1ab398647cfda6e5efc06222a46c (patch)
treee536633959fe4d7e5d903aa74fab0ae290e8c97d /lib/bfd.c
parenteb04e6e3c42901036b1b8c4d31ccab22fb133626 (diff)
bfdd, lib, bgpd: add bfd cbit usage
bfd cbit is a value carried out in bfd messages, that permit to keep or not, the independence between control plane and dataplane. In other words, while most of the cases plan to flush entries, when bfd goes down, there are some cases where that bfd event should be ignored. this is the case with non stop forwarding mechanisms where entries may be kept. this is the case for BGP, when graceful restart capability is used. If BFD event down happens, and bgp is in graceful restart mode, it is wished to ignore the BFD event while waiting for the remote router to restart. The changes take into account the following: - add a config flag across zebra layer so that daemon can set or not the cbit capability. - ability for daemons to read the remote bfd capability associated to a bfd notification. - in bfdd, according to the value, the cbit value is set - in bfdd, the received value is retrived and stored in the bfd session context. - by default, the local cbit announced to remote is set to 1 while preservation of the local path is not set. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Diffstat (limited to 'lib/bfd.c')
-rw-r--r--lib/bfd.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/bfd.c b/lib/bfd.c
index a8956c315c..00dbd1b3d1 100644
--- a/lib/bfd.c
+++ b/lib/bfd.c
@@ -127,8 +127,8 @@ void bfd_set_param(struct bfd_info **bfd_info, uint32_t min_rx, uint32_t min_tx,
*/
void bfd_peer_sendmsg(struct zclient *zclient, struct bfd_info *bfd_info,
int family, void *dst_ip, void *src_ip, char *if_name,
- int ttl, int multihop, int command, int set_flag,
- vrf_id_t vrf_id)
+ int ttl, int multihop, int cbit, int command,
+ int set_flag, vrf_id_t vrf_id)
{
struct stream *s;
int ret;
@@ -208,6 +208,11 @@ void bfd_peer_sendmsg(struct zclient *zclient, struct bfd_info *bfd_info,
stream_putc(s, 0);
}
}
+ /* cbit */
+ if (cbit)
+ stream_putc(s, 1);
+ else
+ stream_putc(s, 0);
stream_putw_at(s, 0, stream_get_endp(s));
@@ -253,11 +258,13 @@ const char *bfd_get_command_dbg_str(int command)
*/
struct interface *bfd_get_peer_info(struct stream *s, struct prefix *dp,
struct prefix *sp, int *status,
+ int *remote_cbit,
vrf_id_t vrf_id)
{
unsigned int ifindex;
struct interface *ifp = NULL;
int plen;
+ int local_remote_cbit;
/* Get interface index. */
ifindex = stream_getl(s);
@@ -292,6 +299,9 @@ struct interface *bfd_get_peer_info(struct stream *s, struct prefix *dp,
stream_get(&sp->u.prefix, s, plen);
sp->prefixlen = stream_getc(s);
}
+ local_remote_cbit = stream_getc(s);
+ if (remote_cbit)
+ *remote_cbit = local_remote_cbit;
return ifp;
}