From c5c10006c01ea72b135487861f0618171e4bddfd Mon Sep 17 00:00:00 2001 From: Michael Lechner Date: Sat, 8 Jun 2019 20:33:48 -0400 Subject: Support ipv4-flowspec for VRF enslaved neighbor --- pkg/server/peer.go | 4 ++++ pkg/server/server.go | 12 ++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) (limited to 'pkg') diff --git a/pkg/server/peer.go b/pkg/server/peer.go index 910c7472..f7b89371 100644 --- a/pkg/server/peer.go +++ b/pkg/server/peer.go @@ -228,6 +228,10 @@ func (peer *peer) toGlobalFamilies(families []bgp.RouteFamily) []bgp.RouteFamily fs = append(fs, bgp.RF_IPv4_VPN) case bgp.RF_IPv6_UC: fs = append(fs, bgp.RF_IPv6_VPN) + case bgp.RF_FS_IPv4_UC: + fs = append(fs, bgp.RF_FS_IPv4_VPN) + case bgp.RF_FS_IPv6_UC: + fs = append(fs, bgp.RF_FS_IPv6_VPN) default: log.WithFields(log.Fields{ "Topic": "Peer", diff --git a/pkg/server/server.go b/pkg/server/server.go index 647843da..82efeb6a 100644 --- a/pkg/server/server.go +++ b/pkg/server/server.go @@ -610,7 +610,7 @@ func (s *BgpServer) prePolicyFilterpath(peer *peer, path, old *table.Path) (*tab peerVrf := peer.fsm.pConf.Config.Vrf peer.fsm.lock.RUnlock() if path != nil && peerVrf != "" { - if f := path.GetRouteFamily(); f != bgp.RF_IPv4_VPN && f != bgp.RF_IPv6_VPN { + if f := path.GetRouteFamily(); f != bgp.RF_IPv4_VPN && f != bgp.RF_IPv6_VPN && f != bgp.RF_FS_IPv4_VPN && f != bgp.RF_FS_IPv6_VPN { return nil, nil, true } vrf := peer.localRib.Vrfs[peerVrf] @@ -1242,6 +1242,10 @@ func (s *BgpServer) propagateUpdateToNeighbors(source *peer, newPath *table.Path return bgp.RF_IPv4_UC case bgp.RF_IPv6_VPN: return bgp.RF_IPv6_UC + case bgp.RF_FS_IPv4_VPN: + return bgp.RF_FS_IPv4_UC + case bgp.RF_FS_IPv6_VPN: + return bgp.RF_FS_IPv6_UC } } return family @@ -2426,6 +2430,10 @@ func (s *BgpServer) getVrfRib(name string, family bgp.RouteFamily, prefixes []*t af = bgp.RF_IPv4_VPN case bgp.RF_IPv6_UC: af = bgp.RF_IPv6_VPN + case bgp.RF_FS_IPv4_UC: + af = bgp.RF_FS_IPv4_VPN + case bgp.RF_FS_IPv6_UC: + af = bgp.RF_FS_IPv6_VPN case bgp.RF_EVPN: af = bgp.RF_EVPN } @@ -2763,7 +2771,7 @@ func (s *BgpServer) addNeighbor(c *config.Neighbor) error { } families, _ := config.AfiSafis(c.AfiSafis).ToRfList() for _, f := range families { - if f != bgp.RF_IPv4_UC && f != bgp.RF_IPv6_UC { + if f != bgp.RF_IPv4_UC && f != bgp.RF_IPv6_UC && f != bgp.RF_FS_IPv4_UC && f != bgp.RF_FS_IPv6_UC { return fmt.Errorf("%s is not supported for VRF enslaved neighbor", f) } } -- cgit v1.2.3