diff options
Diffstat (limited to 'packet/bgp/validate.go')
-rw-r--r-- | packet/bgp/validate.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/packet/bgp/validate.go b/packet/bgp/validate.go index da7aa5fc..5cf2afbb 100644 --- a/packet/bgp/validate.go +++ b/packet/bgp/validate.go @@ -159,6 +159,21 @@ func ValidateAttribute(a PathAttributeInterface, rfs map[RouteFamily]bool, doCon } } } + case *PathAttributeLargeCommunities: + uniq := make([]*LargeCommunity, 0, len(p.Values)) + for _, x := range p.Values { + found := false + for _, y := range uniq { + if x.String() == y.String() { + found = true + break + } + } + if !found { + uniq = append(uniq, x) + } + } + p.Values = uniq case *PathAttributeUnknown: if p.GetFlags()&BGP_ATTR_FLAG_OPTIONAL == 0 { |