summaryrefslogtreecommitdiffhomepage
path: root/internal
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@gmail.com>2020-11-01 22:46:29 +0900
committerFUJITA Tomonori <fujita.tomonori@gmail.com>2020-11-09 12:35:07 +0900
commitc297c0b222445df27e8e0642cbddf91be9ca8eb4 (patch)
tree7a7180eded11e28daf3c666b69d83b8ba34061e6 /internal
parent46b15a7512c655683218ae867b2d42b99a73985e (diff)
server: handle bogus addpath argument
Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
Diffstat (limited to 'internal')
-rw-r--r--internal/pkg/apiutil/attribute.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/internal/pkg/apiutil/attribute.go b/internal/pkg/apiutil/attribute.go
index 8422f3f3..9b73786a 100644
--- a/internal/pkg/apiutil/attribute.go
+++ b/internal/pkg/apiutil/attribute.go
@@ -1506,6 +1506,9 @@ func unmarshalAttribute(an *any.Any) (bgp.PathAttributeInterface, error) {
}
return bgp.NewPathAttributeClusterList(a.Ids), nil
case *api.MpReachNLRIAttribute:
+ if a.Family == nil {
+ return nil, fmt.Errorf("empty family")
+ }
rf := ToRouteFamily(a.Family)
nlris, err := UnmarshalNLRIs(rf, a.Nlris)
if err != nil {