Merge pull request #589 from mars1024/feat/sysctl

portmap: use slashes in sysctl template to support interface names which separated by dots
This commit is contained in:
Dan Williams 2021-03-03 10:19:02 -06:00 committed by GitHub
commit 1c1799ef39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
}