mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Use netlink.LinkByName instead of net.InterfaceByName
It's x350 time faster. Signed-off-by: Alexander Morozov <lk4d4@docker.com>
This commit is contained in:
parent
604753b43a
commit
537ba03dd1
1 changed files with 2 additions and 2 deletions
|
@ -161,8 +161,8 @@ func GenerateIfaceName(prefix string, len int) (string, error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if _, err := net.InterfaceByName(name); err != nil {
|
if _, err := netlink.LinkByName(name); err != nil {
|
||||||
if strings.Contains(err.Error(), "no such") {
|
if strings.Contains(err.Error(), "not found") {
|
||||||
return name, nil
|
return name, nil
|
||||||
}
|
}
|
||||||
return "", err
|
return "", err
|
||||||
|
|
Loading…
Reference in a new issue