diff options
author | IWASE Yusuke <iwase.yusuke0@gmail.com> | 2017-07-13 13:13:27 +0900 |
---|---|---|
committer | IWASE Yusuke <iwase.yusuke0@gmail.com> | 2017-07-13 16:18:42 +0900 |
commit | 1ab232c751772d3501ee3d84be8fce095b091ca6 (patch) | |
tree | a516e401686a7da317acbe881dbe22377e5cb5c2 /config/default.go | |
parent | 4b5e13376c70481aacc1c2c508738279f8cc9e5c (diff) |
config/default: Reduce parsing CIDR string
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Diffstat (limited to 'config/default.go')
-rw-r--r-- | config/default.go | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/config/default.go b/config/default.go index 81ffe00f..d0be6d6b 100644 --- a/config/default.go +++ b/config/default.go @@ -75,9 +75,8 @@ func getIPv6LinkLocalAddress(ifname string) (string, error) { return "", err } for _, addr := range addrs { - if ip, _, err := net.ParseCIDR(addr.String()); err != nil { - return "", err - } else if ip.To4() == nil && ip.IsLinkLocalUnicast() { + ip := addr.(*net.IPNet).IP + if ip.To4() == nil && ip.IsLinkLocalUnicast() { return fmt.Sprintf("%s%%%s", ip.String(), ifname), nil } } |