File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -543,10 +543,14 @@ func (s *Server) WatchBGPPath(t *tomb.Tomb) error {
543543 peer := localPeer .Peer
544544 filters := localPeer .BGPFilterNames
545545 // create a neighbor set to apply filter only on specific peer using a global policy
546+ prefixLen := "/32"
547+ if ip := net .ParseIP (peer .Conf .NeighborAddress ); ip != nil && ip .To4 () == nil {
548+ prefixLen = "/128"
549+ }
546550 neighborSet := & bgpapi.DefinedSet {
547551 Name : peer .Conf .NeighborAddress + "neighbor" ,
548552 DefinedType : bgpapi .DefinedType_NEIGHBOR ,
549- List : []string {peer .Conf .NeighborAddress + "/32" },
553+ List : []string {peer .Conf .NeighborAddress + prefixLen },
550554 }
551555 err := s .BGPServer .AddDefinedSet (context .Background (), & bgpapi.AddDefinedSetRequest {
552556 DefinedSet : neighborSet ,
You can’t perform that action at this time.
0 commit comments