mirror of
https://github.com/vishvananda/netlink
synced 2025-02-09 00:26:54 +00:00
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 {
|
if err != nil {
|
||||||
return nil, err
|
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.
|
// NewIPNet generates an IPNet from an ip address using a netmask of 32 or 128.
|
||||||
|
Loading…
Reference in New Issue
Block a user