summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-10-15 12:37:12 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-10-15 12:37:12 +0900
commitb03ccd2d7e4afae8bfb6c1cbdb8af6f23356c974 (patch)
tree326267b668904f2c1493582c5dcd29c11c8d245d
parent0f56c9d00caf90c835a885b5c83778decc3885c6 (diff)
gobgp: fix the default address family handling
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--gobgp/cmd/common.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/gobgp/cmd/common.go b/gobgp/cmd/common.go
index fbe7b118..bbe26ea5 100644
--- a/gobgp/cmd/common.go
+++ b/gobgp/cmd/common.go
@@ -443,10 +443,10 @@ func connGrpc() *grpc.ClientConn {
}
func addr2AddressFamily(a net.IP) bgp.RouteFamily {
- if a.To16() != nil {
- return bgp.RF_IPv6_UC
+ if a.To4() != nil {
+ return bgp.RF_IPv4_UC
}
- return bgp.RF_IPv4_UC
+ return bgp.RF_IPv6_UC
}
func checkAddressFamily(def bgp.RouteFamily) (bgp.RouteFamily, error) {