summaryrefslogtreecommitdiffhomepage
path: root/pkg/server/zclient.go
diff options
context:
space:
mode:
authormageshgv <mageshgv@gmail.com>2019-10-08 14:35:33 -0700
committerFUJITA Tomonori <fujita.tomonori@gmail.com>2019-10-15 20:58:16 +0900
commit0235f7c67539e199eb59e7ffb09409e07a8d13e0 (patch)
treece88a843a13a5f708268212176759ff54ae812f7 /pkg/server/zclient.go
parentbfb371d0c2f543c7dd5ee4afa112a6546c886ec2 (diff)
Support vrfs in zapi multipath
Diffstat (limited to 'pkg/server/zclient.go')
-rw-r--r--pkg/server/zclient.go24
1 files changed, 8 insertions, 16 deletions
diff --git a/pkg/server/zclient.go b/pkg/server/zclient.go
index 390628f0..c002851a 100644
--- a/pkg/server/zclient.go
+++ b/pkg/server/zclient.go
@@ -421,27 +421,19 @@ func (z *zebraClient) loop() {
if table.UseMultiplePaths.Enabled {
for _, paths := range msg.MultiPathList {
z.updatePathByNexthopCache(paths)
- if body, isWithdraw := newIPRouteBody(paths, 0, z); body != nil {
- z.client.SendIPRoute(0, body, isWithdraw)
- }
- if body := newNexthopRegisterBody(paths, z.nexthopCache); body != nil {
- z.client.SendNexthopRegister(0, body, false)
+ for i := range msg.Vrf {
+ if body, isWithdraw := newIPRouteBody(paths, i, z); body != nil {
+ z.client.SendIPRoute(i, body, isWithdraw)
+ }
+ if body := newNexthopRegisterBody(paths, z.nexthopCache); body != nil {
+ z.client.SendNexthopRegister(i, body, false)
+ }
}
}
} else {
z.updatePathByNexthopCache(msg.PathList)
for _, path := range msg.PathList {
- vrfs := []uint32{0}
- if msg.Vrf != nil {
- for vrfId := range msg.Vrf {
- vrfs = append(vrfs, vrfId)
- }
- }
- for _, i := range vrfs {
- routeFamily := path.GetRouteFamily()
- if i == zebra.VRF_DEFAULT && (routeFamily == bgp.RF_IPv4_VPN || routeFamily == bgp.RF_IPv6_VPN) {
- continue
- }
+ for i := range msg.Vrf {
if body, isWithdraw := newIPRouteBody([]*table.Path{path}, i, z); body != nil {
err := z.client.SendIPRoute(i, body, isWithdraw)
if err != nil {