6e225e3759344683fa32cb196828a1a7d7387976
[lede-routing/.git] / patches / 100-no_forwarding_override.patch
1 --- a/src/linux/net.c
2 +++ b/src/linux/net.c
3 @@ -106,6 +106,7 @@ bind_socket_to_device(int sock, char *de
4  int
5  enable_ip_forwarding(int version)
6  {
7 +#if 0
8    FILE *proc_fwd;
9    const char *const procfile = version == AF_INET ? "/proc/sys/net/ipv4/ip_forward" : "/proc/sys/net/ipv6/conf/all/forwarding";
10  
11 @@ -141,6 +142,7 @@ enable_ip_forwarding(int version)
12      }
13      fclose(proc_fwd);
14    }
15 +#endif
16    return 1;
17  }
18  
19 @@ -267,6 +269,7 @@ restore_settings(int version)
20    OLSR_PRINTF(1, "Restoring network state\n");
21  
22    /* Restore IP forwarding to "off" */
23 +#if 0
24    if (orig_fwd_state == '0') {
25      const char *const procfile = version == AF_INET ? "/proc/sys/net/ipv4/ip_forward" : "/proc/sys/net/ipv6/conf/all/forwarding";
26      FILE *proc_fd;
27 @@ -279,6 +282,7 @@ restore_settings(int version)
28        fclose(proc_fd);
29      }
30    }
31 +#endif
32  
33    /* Restore global ICMP redirect setting */
34    if (orig_global_redirect_state != '0') {