• Pavel Tikhomirov's avatar
    net/sysctl: fix ipv4 forwarding · 1c954ab8
    Pavel Tikhomirov authored
    Restore all/accept_redirects and default/forwarding after
    all/forwarding as the last can influence the former two.
    (see inet_forward_change in kernel)
    
    # sysctl -w net.ipv4.conf.all.forwarding=1
    net.ipv4.conf.all.forwarding = 1
    # sysctl -w net.ipv4.conf.default.forwarding=1
    net.ipv4.conf.default.forwarding = 1
    # sysctl -w net.ipv4.conf.all.forwarding=0
    net.ipv4.conf.all.forwarding = 0
    # sysctl net.ipv4.conf.default.forwarding
    net.ipv4.conf.default.forwarding = 0
    
    Trigered with netns-dev test in VZ7CT with vzlinux-6-x86_64 template
    v2:quirk accept_redirects instead of duplicate entries in devconfs
    Signed-off-by: 's avatarPavel Tikhomirov <ptikhomirov@virtuozzo.com>
    Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
    1c954ab8
net.c 40.7 KB