diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-10-09 20:50:24 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-10-09 20:50:24 +0900 |
commit | 840755be18f226b202759aea8318de20ccc32057 (patch) | |
tree | 9f106e9e1e82b992a38324b65145434e334aea71 | |
parent | dbec787c7b3724f5f694036402fdbc001433955d (diff) |
gobpg: fix global command
ipv4 should be used if an address family is not specified.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r-- | gobgp/cmd/common.go | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/gobgp/cmd/common.go b/gobgp/cmd/common.go index ece1f53b..fbe7b118 100644 --- a/gobgp/cmd/common.go +++ b/gobgp/cmd/common.go @@ -443,12 +443,10 @@ func connGrpc() *grpc.ClientConn { } func addr2AddressFamily(a net.IP) bgp.RouteFamily { - if a == nil { - return bgp.RouteFamily(0) - } else if a.To4() != nil { - return bgp.RF_IPv4_UC + if a.To16() != nil { + return bgp.RF_IPv6_UC } - return bgp.RF_IPv6_UC + return bgp.RF_IPv4_UC } func checkAddressFamily(def bgp.RouteFamily) (bgp.RouteFamily, error) { |