Ticket #230: patch

File patch, 3.7 KB (added by sthibault, 10 years ago)
  • doc/openvpn.8

    diff --git a/doc/openvpn.8 b/doc/openvpn.8
    index 3a58317..8b601f7 100644
    a b and 
    58675867scripts.
    58685868.\"*********************************************************
    58695869.TP
     5870.B ifconfig_ipv6_pool_remote_ip
     5871The remote
     5872virtual IPv6 address for the TUN/TAP tunnel taken from an
     5873.B \-\-ifconfig-ipv6-push
     5874directive if specified, or otherwise from
     5875the ifconfig pool (controlled by the
     5876.B \-\-ifconfig-ipv6-pool
     5877config file directive).
     5878This option is set on the server prior to execution
     5879of the
     5880.B \-\-client-connect
     5881and
     5882.B \-\-client-disconnect
     5883scripts.
     5884.\"*********************************************************
     5885.TP
    58705886.B link_mtu
    58715887The maximum packet size (not including the IP header)
    58725888of tunnel data in UDP tunnel transport mode.
  • src/openvpn/manage.c

    diff --git a/src/openvpn/manage.c b/src/openvpn/manage.c
    index 9f44cd9..ce5b039 100644
    a b env_filter_match (const char *env_str, const int env_filter_level) 
    24162416    "dev=",
    24172417    "ifconfig_pool_remote_ip=",
    24182418    "ifconfig_pool_netmask=",
     2419    "ifconfig_ipv6_pool_remote_ip=",
    24192420    "time_duration=",
    24202421    "bytes_sent=",
    24212422    "bytes_received="
  • src/openvpn/multi.c

    diff --git a/src/openvpn/multi.c b/src/openvpn/multi.c
    index 2839b30..ced59e5 100644
    a b multi_set_virtual_addr_env (struct multi_context *m, struct multi_instance *mi) 
    14321432        }
    14331433    }
    14341434
    1435     /* TODO: I'm not exactly sure what these environment variables are
    1436      *       used for, but if we have them for IPv4, we should also have
    1437      *       them for IPv6, no?
    1438      */
     1435  setenv_del (mi->context.c2.es, "ifconfig_ipv6_pool_remote_ip");
     1436
     1437  if (mi->context.c2.push_ifconfig_ipv6_defined)
     1438    {
     1439      setenv_in6_addr_t (mi->context.c2.es,
     1440                        "ifconfig_ipv6_pool_remote_ip",
     1441                        &mi->context.c2.push_ifconfig_ipv6_local,
     1442                        SA_SET_IF_NONZERO);
     1443    }
     1444
    14391445}
    14401446
    14411447/*
  • src/openvpn/socket.c

    diff --git a/src/openvpn/socket.c b/src/openvpn/socket.c
    index ed4bc6f..fbb1c34 100644
    a b setenv_sockaddr (struct env_set *es, const char *name_prefix, const struct openv 
    26022602        }
    26032603      break;
    26042604    case AF_INET6:
    2605       openvpn_snprintf (name_buf, sizeof (name_buf), "%s_ip6", name_prefix);
     2605      if (flags & SA_IP_PORT)
     2606        openvpn_snprintf (name_buf, sizeof (name_buf), "%s_ip6", name_prefix);
     2607      else
     2608        openvpn_snprintf (name_buf, sizeof (name_buf), "%s", name_prefix);
    26062609      getnameinfo(&addr->addr.sa, sizeof (struct sockaddr_in6),
    26072610                  buf, sizeof(buf), NULL, 0, NI_NUMERICHOST);
    26082611      setenv_str (es, name_buf, buf);
    setenv_in_addr_t (struct env_set *es, const char *name_prefix, in_addr_t addr, c 
    26302633}
    26312634
    26322635void
     2636setenv_in6_addr_t (struct env_set *es, const char *name_prefix, struct in6_addr *addr, const bool flags)
     2637{
     2638  if ( memcmp(addr, &in6addr_any, sizeof(*addr)) != 0 || !(flags & SA_SET_IF_NONZERO))
     2639    {
     2640      struct openvpn_sockaddr si;
     2641      CLEAR (si);
     2642      si.addr.in6.sin6_family = AF_INET6;
     2643      si.addr.in6.sin6_addr = *addr;
     2644      setenv_sockaddr (es, name_prefix, &si, flags);
     2645    }
     2646}
     2647
     2648void
    26332649setenv_link_socket_actual (struct env_set *es,
    26342650                           const char *name_prefix,
    26352651                           const struct link_socket_actual *act,
  • src/openvpn/socket.h

    diff --git a/src/openvpn/socket.h b/src/openvpn/socket.h
    index bffa039..c31bce9 100644
    a b void setenv_in_addr_t (struct env_set *es, 
    420420                       in_addr_t addr,
    421421                       const unsigned int flags);
    422422
     423void setenv_in6_addr_t (struct env_set *es,
     424                        const char *name_prefix,
     425                        struct in6_addr *addr,
     426                        const bool flags);
     427
    423428void setenv_link_socket_actual (struct env_set *es,
    424429                                const char *name_prefix,
    425430                                const struct link_socket_actual *act,