diff options
Diffstat (limited to 'api/grpc_server.go')
-rw-r--r-- | api/grpc_server.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/api/grpc_server.go b/api/grpc_server.go index f167c13f..9fc66bde 100644 --- a/api/grpc_server.go +++ b/api/grpc_server.go @@ -1001,12 +1001,12 @@ func (s *Server) DeleteNeighbor(ctx context.Context, arg *DeleteNeighborRequest) } func NewPrefixFromApiStruct(a *Prefix) (*table.Prefix, error) { - addr, prefix, err := net.ParseCIDR(a.IpPrefix) + _, prefix, err := net.ParseCIDR(a.IpPrefix) if err != nil { return nil, err } rf := bgp.RF_IPv4_UC - if addr.To4() == nil { + if strings.Contains(a.IpPrefix, ":") { rf = bgp.RF_IPv6_UC } return &table.Prefix{ |