[frr] [PATCH 07/11] bgpd: ability to set multipath per vrf

Philippe Guibert philippe.guibert at 6wind.com
Wed Dec 21 09:13:52 EST 2016


This commit introduces a new flag to configure multipath per
address-family.

Signed-off-by: Philippe Guibert <philippe.guibert at 6wind.com>
---
 bgpd/bgpd.c | 14 ++++++++++++++
 bgpd/bgpd.h |  4 ++++
 2 files changed, 18 insertions(+)

diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c
index f055f6853084..b38ae147a9e4 100644
--- a/bgpd/bgpd.c
+++ b/bgpd/bgpd.c
@@ -194,6 +194,20 @@ bgp_flag_unset (struct bgp *bgp, int flag)
 }
 
 int
+bgp_af_flag_set (struct bgp *bgp, afi_t afi, safi_t safi, int flag)
+{
+  SET_FLAG (bgp->af_flags[afi][safi], flag);
+  return 0;
+}
+
+int
+bgp_af_flag_unset (struct bgp *bgp, afi_t afi, safi_t safi, int flag)
+{
+  UNSET_FLAG (bgp->af_flags[afi][safi], flag);
+  return 0;
+}
+
+int
 bgp_flag_check (struct bgp *bgp, int flag)
 {
   return CHECK_FLAG (bgp->flags, flag);
diff --git a/bgpd/bgpd.h b/bgpd/bgpd.h
index 00d96b51603f..c65bad13743c 100644
--- a/bgpd/bgpd.h
+++ b/bgpd/bgpd.h
@@ -295,6 +295,8 @@ struct bgp
   /* BGP Per AF flags */
   u_int16_t af_flags[AFI_MAX][SAFI_MAX];
 #define BGP_CONFIG_DAMPENING              (1 << 0)
+#define BGP_CONFIG_ASPATH_MULTIPATH_RELAX (1 << 1)
+#define BGP_CONFIG_MULTIPATH              (1 << 2)
 
   /* Route table for next-hop lookup cache. */
   struct bgp_table *nexthop_cache_table[AFI_MAX];
@@ -1241,6 +1243,8 @@ extern int bgp_delete (struct bgp *);
 extern int bgp_flag_set (struct bgp *, int);
 extern int bgp_flag_unset (struct bgp *, int);
 extern int bgp_flag_check (struct bgp *, int);
+extern int bgp_af_flag_set (struct bgp *, afi_t, safi_t, int);
+extern int bgp_af_flag_unset (struct bgp *, afi_t, safi_t, int);
 
 extern void bgp_lock (struct bgp *);
 extern void bgp_unlock (struct bgp *);
-- 
2.1.4





More information about the dev mailing list