diff options
author | IWASE Yusuke <iwase.yusuke0@gmail.com> | 2017-11-15 13:05:18 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2017-11-21 10:56:23 +0900 |
commit | f974b98c6acd8d298c27fb5f7c0c4b2925c5de19 (patch) | |
tree | 04361a3208ce3ff705b7fe605d786b4331ce4dfd | |
parent | b94f12feaec48a8968f5b60c5dd9197dec4b6e43 (diff) |
cli: Use network IP address for EVPN Prefix route
Currently, "gobgp" command use the host IP when adding a new EVPN Prefix
route, but it should be the network IP address, otherwise the two routes
to "192.168.0.1/24" and "192.168.0.2/24" will be determined as different
routes.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
-rw-r--r-- | gobgp/cmd/global.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gobgp/cmd/global.go b/gobgp/cmd/global.go index 0842b124..a7958e37 100644 --- a/gobgp/cmd/global.go +++ b/gobgp/cmd/global.go @@ -505,11 +505,11 @@ func ParseEvpnIPPrefixArgs(args []string) (bgp.AddrPrefixInterface, []string, er } } - ip, n, err := net.ParseCIDR(m[""][0]) + _, nw, err := net.ParseCIDR(m[""][0]) if err != nil { return nil, nil, err } - ones, _ := n.Mask.Size() + ones, _ := nw.Mask.Size() var gw net.IP if len(m["gw"]) > 0 { @@ -549,7 +549,7 @@ func ParseEvpnIPPrefixArgs(args []string) (bgp.AddrPrefixInterface, []string, er RD: rd, ETag: etag, IPPrefixLength: uint8(ones), - IPPrefix: ip, + IPPrefix: nw.IP, GWIPAddress: gw, Label: label, } |