Merge pull request #586 from containernetworking/macvlan/stop-setting-proxy-arp
[macvlan] Stop setting proxy-arp on macvlan interface
This commit is contained in:
commit
8936113a16
@ -33,11 +33,6 @@ import (
|
|||||||
"github.com/containernetworking/plugins/pkg/ipam"
|
"github.com/containernetworking/plugins/pkg/ipam"
|
||||||
"github.com/containernetworking/plugins/pkg/ns"
|
"github.com/containernetworking/plugins/pkg/ns"
|
||||||
bv "github.com/containernetworking/plugins/pkg/utils/buildversion"
|
bv "github.com/containernetworking/plugins/pkg/utils/buildversion"
|
||||||
"github.com/containernetworking/plugins/pkg/utils/sysctl"
|
|
||||||
)
|
|
||||||
|
|
||||||
const (
|
|
||||||
IPv4InterfaceArpProxySysctlTemplate = "net.ipv4.conf.%s.proxy_arp"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type NetConf struct {
|
type NetConf struct {
|
||||||
@ -208,14 +203,6 @@ func createMacvlan(conf *NetConf, ifName string, netns ns.NetNS) (*current.Inter
|
|||||||
}
|
}
|
||||||
|
|
||||||
err = netns.Do(func(_ ns.NetNS) error {
|
err = netns.Do(func(_ ns.NetNS) error {
|
||||||
// TODO: duplicate following lines for ipv6 support, when it will be added in other places
|
|
||||||
ipv4SysctlValueName := fmt.Sprintf(IPv4InterfaceArpProxySysctlTemplate, tmpName)
|
|
||||||
if _, err := sysctl.Sysctl(ipv4SysctlValueName, "1"); err != nil {
|
|
||||||
// remove the newly added link and ignore errors, because we already are in a failed state
|
|
||||||
_ = netlink.LinkDel(mv)
|
|
||||||
return fmt.Errorf("failed to set proxy_arp on newly added interface %q: %v", tmpName, err)
|
|
||||||
}
|
|
||||||
|
|
||||||
err := ip.RenameLink(tmpName, ifName)
|
err := ip.RenameLink(tmpName, ifName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
_ = netlink.LinkDel(mv)
|
_ = netlink.LinkDel(mv)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user