From 6a9a3cde582277e37ff024b72b6022efcf1a5884 Mon Sep 17 00:00:00 2001 From: Julien Courtat Date: Fri, 20 May 2016 12:10:07 +0200 Subject: bgpd: enable send of Graceful Restart Preserve State F bit Enhance struct bgp to add a new flag BGP_FLAG_GR_PRESERVE_FWD, which allow to set the Preserve State F bit of Graceful Restart capability in OPEN messages. Signed-off-by: Julien Courtat --- bgpd/bgp_open.c | 5 ++++- bgpd/bgpd.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/bgpd/bgp_open.c b/bgpd/bgp_open.c index 4c698562b..af3c0486e 100644 --- a/bgpd/bgp_open.c +++ b/bgpd/bgp_open.c @@ -1537,7 +1537,10 @@ bgp_open_capability (struct stream *s, struct peer *peer) { stream_putw (s, afi); stream_putc (s, (safi == SAFI_MPLS_VPN) ? SAFI_MPLS_LABELED_VPN : safi); - stream_putc (s, 0); //Forwarding is not retained as of now. + if (bgp_flag_check(peer->bgp, BGP_FLAG_GR_PRESERVE_FWD)) + stream_putc (s, RESTART_F_BIT); + else + stream_putc (s, 0); } } diff --git a/bgpd/bgpd.h b/bgpd/bgpd.h index 86fa207b6..b82cf9dde 100644 --- a/bgpd/bgpd.h +++ b/bgpd/bgpd.h @@ -289,6 +289,7 @@ struct bgp #define BGP_FLAG_MULTIPATH_RELAX_AS_SET (1 << 17) #define BGP_FLAG_FORCE_STATIC_PROCESS (1 << 18) #define BGP_FLAG_SHOW_HOSTNAME (1 << 19) +#define BGP_FLAG_GR_PRESERVE_FWD (1 << 20) /* BGP Per AF flags */ u_int16_t af_flags[AFI_MAX][SAFI_MAX]; -- cgit v1.2.3