summaryrefslogtreecommitdiffhomepage
path: root/config/default.go
diff options
context:
space:
mode:
authorIWASE Yusuke <iwase.yusuke0@gmail.com>2017-07-13 13:13:27 +0900
committerIWASE Yusuke <iwase.yusuke0@gmail.com>2017-07-13 16:18:42 +0900
commit1ab232c751772d3501ee3d84be8fce095b091ca6 (patch)
treea516e401686a7da317acbe881dbe22377e5cb5c2 /config/default.go
parent4b5e13376c70481aacc1c2c508738279f8cc9e5c (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.go5
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
}
}