mirror of https://github.com/vishvananda/netlink
Reduce allocations
This commit is contained in:
parent
b48eed5d7d
commit
d741264626
|
@ -27,7 +27,8 @@ func ParseIPNet(s string) (*net.IPNet, error) {
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &net.IPNet{IP: ip, Mask: ipNet.Mask}, nil
|
||||
ipNet.IP = ip
|
||||
return ipNet, nil
|
||||
}
|
||||
|
||||
// NewIPNet generates an IPNet from an ip address using a netmask of 32 or 128.
|
||||
|
|
Loading…
Reference in New Issue