plugins/ptp: set the host veth hwaddr correctly
This commit is contained in:
parent
7d19c01818
commit
55fd81f775
@ -64,11 +64,14 @@ func setupContainerVeth(netns, ifName string, mtu int, pr *types.Result) (string
|
||||
return err
|
||||
}
|
||||
|
||||
hostVethName = hostVeth.Attrs().Name
|
||||
hostNS.Do(func(_ ns.NetNS) error {
|
||||
hostVethName = hostVeth.Attrs().Name
|
||||
if err := ip.SetHWAddrByIP(hostVethName, pr.IP4.IP.IP, nil /* TODO IPv6 */); err != nil {
|
||||
return fmt.Errorf("failed to set hardware addr by IP: %v", err)
|
||||
}
|
||||
|
||||
if err := ip.SetHWAddrByIP(hostVethName, pr.IP4.IP.IP, nil /* TODO IPv6 */); err != nil {
|
||||
return fmt.Errorf("failed to set hardware addr by IP: %v", err)
|
||||
}
|
||||
return nil
|
||||
})
|
||||
|
||||
if err = ipam.ConfigureIface(ifName, pr); err != nil {
|
||||
return err
|
||||
|
Loading…
x
Reference in New Issue
Block a user