summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorIWASE Yusuke <iwase.yusuke0@gmail.com>2017-11-13 16:00:42 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2017-11-21 10:56:23 +0900
commita1b2ef3e8e1009ed6f9e8e9b389a70c41ee74399 (patch)
tree5c2745abf67ad14bbd47faa698b815318e0a0932
parent0564b24aef48f5821e97055d1b1e6eef5b73d14e (diff)
gobgp/cmd/global: Fix name collision "net"
The variable "net" in ParsePath() collides the name of the standard library name "net". Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
-rw-r--r--gobgp/cmd/global.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/gobgp/cmd/global.go b/gobgp/cmd/global.go
index f2904e8b..30f94b5f 100644
--- a/gobgp/cmd/global.go
+++ b/gobgp/cmd/global.go
@@ -771,11 +771,11 @@ func ParsePath(rf bgp.RouteFamily, args []string) (*table.Path, error) {
if len(args) < 1 {
return nil, fmt.Errorf("invalid format")
}
- ip, net, err := net.ParseCIDR(args[0])
+ ip, nw, err := net.ParseCIDR(args[0])
if err != nil {
return nil, err
}
- ones, _ := net.Mask.Size()
+ ones, _ := nw.Mask.Size()
if rf == bgp.RF_IPv4_UC {
if ip.To4() == nil {
return nil, fmt.Errorf("invalid ipv4 prefix")
@@ -803,8 +803,8 @@ func ParsePath(rf bgp.RouteFamily, args []string) (*table.Path, error) {
if len(args) < 5 || args[1] != "label" || args[3] != "rd" {
return nil, fmt.Errorf("invalid format")
}
- ip, net, _ := net.ParseCIDR(args[0])
- ones, _ := net.Mask.Size()
+ ip, nw, _ := net.ParseCIDR(args[0])
+ ones, _ := nw.Mask.Size()
label := 0
if label, err = strconv.Atoi(args[2]); err != nil {
@@ -835,8 +835,8 @@ func ParsePath(rf bgp.RouteFamily, args []string) (*table.Path, error) {
return nil, fmt.Errorf("invalid format")
}
- ip, net, _ := net.ParseCIDR(args[0])
- ones, _ := net.Mask.Size()
+ ip, nw, _ := net.ParseCIDR(args[0])
+ ones, _ := nw.Mask.Size()
mpls, err := bgp.ParseMPLSLabelStack(args[1])
if err != nil {