mirror of
https://github.com/clearlinux/libnetwork.git
synced 2026-09-06 22:01:55 +00:00
enable hairpin mode on the bridge port & fix iptables rule
* When userland-proxy is disabled, enable hairpin mode on the host-side of the veth * When userland-proxy is enabled, fix the iptable rules appropriately Signed-off-by: Madhu Venugopal <madhu@docker.com>
This commit is contained in:
@@ -876,6 +876,13 @@ func (d *driver) CreateEndpoint(nid, eid types.UUID, epInfo driverapi.EndpointIn
|
||||
return err
|
||||
}
|
||||
|
||||
if !config.EnableUserlandProxy {
|
||||
err = netlink.LinkSetHairpin(host, true)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
// v4 address for the sandbox side pipe interface
|
||||
ip4, err := ipAllocator.RequestIP(n.bridge.bridgeIPv4, nil)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user