From: Julien Courtat Date: Fri, 20 May 2016 10:10:07 +0000 (+0200) Subject: bgpd: enable send of Graceful Restart Preserve State F bit X-Git-Tag: frr-3.0-branchpoint~106^2~1 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=6a9a3cde582277e37ff024b72b6022efcf1a5884;p=mirror%2Ffrr.git 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 --- diff --git a/bgpd/bgp_open.c b/bgpd/bgp_open.c index 4c698562be..af3c0486e5 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 86fa207b6b..b82cf9dde9 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];