summaryrefslogtreecommitdiffhomepage
path: root/pkg/server/server.go
diff options
context:
space:
mode:
authorHitoshi Irino <irino@sfc.wide.ad.jp>2019-03-03 12:48:57 +0900
committerFUJITA Tomonori <fujita.tomonori@gmail.com>2019-03-14 21:20:31 +0900
commit7228b3dc1f1c7dca64bdfd5053244252bccd6180 (patch)
treed7831e9174693a9293b3a20e738f8392c89a5e33 /pkg/server/server.go
parent4967c82a36943d90d1f732bbe4af65b4b39542dc (diff)
Refactoring source code for BGP/MPLS L3VPN with ZAPI 6
- Deleting receiveVrfId (which is introduced on 2 previous commit 90eeb5de870b95345650e3ee98741e040a0b6e93) from Path struct and Introducing pathVrf Map in zclient. - Recovering logic (which is changed on 1 previous commit acfd5bedb6d94775392200db597a5ac420b31b2e) to use assignMplsLabel in server.go. - Refectoring zclient's newIPRouteBody for deleating duplicate logic for IPv4 and IPv6.
Diffstat (limited to 'pkg/server/server.go')
-rw-r--r--pkg/server/server.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/pkg/server/server.go b/pkg/server/server.go
index 71508666..414e5dbf 100644
--- a/pkg/server/server.go
+++ b/pkg/server/server.go
@@ -958,8 +958,10 @@ func (s *BgpServer) propagateUpdate(peer *peer, pathList []*table.Path) {
peer.fsm.lock.RLock()
peerVrf := peer.fsm.pConf.Config.Vrf
peer.fsm.lock.RUnlock()
- path.SetReceiveVrfId(rib.Vrfs[peerVrf].Id)
path = path.ToGlobal(rib.Vrfs[peerVrf])
+ if s.zclient != nil {
+ s.zclient.pathVrf[path] = rib.Vrfs[peerVrf].Id
+ }
}
policyOptions := &table.PolicyOptions{}
@@ -2086,7 +2088,7 @@ func (s *BgpServer) AddVrf(ctx context.Context, r *api.AddVrfRequest) error {
s.propagateUpdate(nil, pathList)
}
if vrf, ok := s.globalRib.Vrfs[name]; ok {
- if s.bgpConfig.Zebra.Config.MplsLabelRangeSize > 0 {
+ if s.zclient != nil && s.zclient.mplsLabelRangeSize > 0 {
go assignMplsLabel(s, vrf)
}
}