diff options
author | Michael Lechner <lechner@netography.com> | 2019-06-08 20:33:48 -0400 |
---|---|---|
committer | Michael Lechner <lechner@netography.com> | 2019-06-08 20:33:48 -0400 |
commit | c5c10006c01ea72b135487861f0618171e4bddfd (patch) | |
tree | 910b48a1265be9561cb30dd272281e06a3773a9a /pkg | |
parent | 9d47a21f32fa0d59730e5da123ef318f494560ce (diff) |
Support ipv4-flowspec for VRF enslaved neighbor
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/server/peer.go | 4 | ||||
-rw-r--r-- | pkg/server/server.go | 12 |
2 files changed, 14 insertions, 2 deletions
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) } } |