summaryrefslogtreecommitdiffhomepage
path: root/pkg/server/grpc_server.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/server/grpc_server.go')
-rw-r--r--pkg/server/grpc_server.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/pkg/server/grpc_server.go b/pkg/server/grpc_server.go
index 25c8495e..3a7121f7 100644
--- a/pkg/server/grpc_server.go
+++ b/pkg/server/grpc_server.go
@@ -310,6 +310,9 @@ func api2Path(resource api.TableType, path *api.Path, isWithdraw bool) (*table.P
case *bgp.PathAttributeNextHop:
nexthop = a.Value.String()
case *bgp.PathAttributeMpReachNLRI:
+ if len(a.Value) == 0 {
+ return nil, fmt.Errorf("invalid mp reach attribute")
+ }
nlri = a.Value[0]
nexthop = a.Nexthop.String()
default: