Advertisement
teknoraver

openvpn_no_ipv6.patch

Oct 1st, 2016
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 0.60 KB | None | 0 0
  1. --- a/src/openvpn/options.c
  2. +++ b/src/openvpn/options.c
  3. @@ -4476,7 +4476,17 @@ add_option (struct options *options,
  4.    else if (streq (p[0], "tun-ipv6"))
  5.      {
  6.        VERIFY_PERMISSION (OPT_P_UP);
  7. -      options->tun_ipv6 = true;
  8. +      FILE *disable_ipv6 = fopen("/proc/sys/net/ipv6/conf/all/disable_ipv6", "r");
  9. +      if (disable_ipv6)
  10. +        {
  11. +     char status;
  12. +     if (fread(&status, 1, 1, disable_ipv6) == 1)
  13. +       {
  14. +         if (status == '0')
  15. +       options->tun_ipv6 = true;
  16. +       }
  17. +     fclose(disable_ipv6);
  18. +   }
  19.      }
  20.  #ifdef ENABLE_IPROUTE
  21.    else if (streq (p[0], "iproute") && p[1])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement