From e09a17fe64f11fc757ae5d4d3fc00f9dd1718eeb Mon Sep 17 00:00:00 2001 From: Bruce Ma Date: Thu, 25 Feb 2021 14:47:34 +0800 Subject: [PATCH] portmap: use slashes in sysctl template to support interface names which separated by dots Signed-off-by: Bruce Ma --- plugins/meta/portmap/portmap.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/meta/portmap/portmap.go b/plugins/meta/portmap/portmap.go index d35136f0..480431be 100644 --- a/plugins/meta/portmap/portmap.go +++ b/plugins/meta/portmap/portmap.go @@ -337,7 +337,7 @@ func genMarkMasqChain(markBit int) chain { // enableLocalnetRouting tells the kernel not to treat 127/8 as a martian, // so that connections with a source ip of 127/8 can cross a routing boundary. func enableLocalnetRouting(ifName string) error { - routeLocalnetPath := "net.ipv4.conf." + ifName + ".route_localnet" + routeLocalnetPath := "net/ipv4/conf/" + ifName + "/route_localnet" _, err := sysctl.Sysctl(routeLocalnetPath, "1") return err }