OpenVPN 2.1_rc22 released
Change log:
2009.11.20 -- Version 2.1_rc22
* Fixed a client-side bug on Windows that occurred when the "dhcp-pre-release" or "dhcp-renew" options were combined with "route-gateway dhcp". The release/renew would not occur because the Windows DHCP renew function is blocking and therefore must be called from another process or thread so as not to stall the tunnel.
* Added a hard failure when peer provides a certificate chain with depth > 16. Previously, a warning was issued.
James
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Quoted 11 lines · James Yonan
Change log:
2009.11.20 -- Version 2.1_rc22
* Fixed a client-side bug on Windows that occurred when the "dhcp-pre-release" or "dhcp-renew" options were combined with "route-gateway dhcp". The release/renew would not occur because the Windows DHCP renew function is blocking and therefore must be called from another process or thread so as not to stall the tunnel.
Quoted 4 lines
* Added a hard failure when peer provides a certificate chain with depth > 16. Previously, a warning was issued.
James
I have updated the patch for providing certificate SHA1 digest/fingerprint via the environment table for plug-ins. This is needed for the eurephia project I'm working on.
The patch is available for download here:
<http://sourceforge.net/projects/eurephia/files/OpenVPN/OpenVPN%20eurephia%20patches/openvpn-2.1_rc22_eurephia.patch/download>
The openvpn source tree with and without this patch can be fetched here:
<git://eurephia.git.sourceforge.net/gitroot/eurephia/openvpn-eurephia.git>
The git tree can be browsed via:
<http://eurephia.git.sourceforge.net/git/gitweb.cgi?p=eurephia/openvpn-eurephia.git;a=summary>
kind regards,
David Sommerseth
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/
iEYEARECAAYFAksGxi8ACgkQDC186MBRfrruMwCdHPAwrLUx7BbUxlGojE8MN66S IaQAnizf5dRn4bIRKFuUzV0WM2Pc2NoV
=GQCZ
-----END PGP SIGNATURE-----
Quoted 1 line
2009.11.20 -- Version 2.1_rc22
Thanks.
For those like me who need to use routing commands with hostnames mapped to more than a single IP, here's an updated patch. IIUC the previous patch should still apply, tho with some offsets.
Stefan
route.c +85 -54
@@ -217,34 +217,39 @@return false; } -static bool +struct route *init_route (struct route *r, +struct route *last_route,const struct route_option *ro,const struct route_special_addr *spec) {const in_addr_t default_netmask = ~0 ;bool status; +int nb =-1 ; +in_addr_t nets[MAX_IPS_PER_HOSTNAME ]; +in_addr_t netmask, gateway; +bool metric_defined; +int metric; - r->option = ro; - r->defined = false; -/* network */ if (!is_route_parm_defined (ro->network)) { goto fail; } - -if (!get_special_addr (spec, ro->network, &r->network, &status)) + +if (get_special_addr (spec, ro->network, &nets[0 ], &status)) + nb =1 ; +else { - r->network =getaddr ( -GETADDR_RESOLVE - |GETADDR_HOST_ORDER - |GETADDR_WARN_ON_SIGNAL , - ro->network, -0 , - &status, -NULL ); + nb =getaddr_all (GETADDR_RESOLVE + |GETADDR_HOST_ORDER + |GETADDR_WARN_ON_SIGNAL , + nets,MAX_IPS_PER_HOSTNAME , + ro->network, +0 , +NULL ); + status = (nb >=0 ); }if (!status)
@@ -254,33 +259,33 @@if (is_route_parm_defined (ro->netmask)) { - r->netmask =getaddr ( -GETADDR_HOST_ORDER - |GETADDR_WARN_ON_SIGNAL , - ro->netmask, -0 , - &status, -NULL ); + netmask =getaddr ( +GETADDR_HOST_ORDER + |GETADDR_WARN_ON_SIGNAL , + ro->netmask, +0 , + &status, +NULL );if (!status) goto fail; }else - r->netmask = default_netmask; + netmask = default_netmask;/* gateway */ - +if (is_route_parm_defined (ro->gateway)) { -if (!get_special_addr (spec, ro->gateway, &r->gateway, &status)) +if (!get_special_addr (spec, ro->gateway, &gateway, &status)) { - r->gateway =getaddr ( -GETADDR_RESOLVE - |GETADDR_HOST_ORDER - |GETADDR_WARN_ON_SIGNAL , - ro->gateway, -0 , - &status, -NULL ); + gateway =getaddr ( +GETADDR_RESOLVE + |GETADDR_HOST_ORDER + |GETADDR_WARN_ON_SIGNAL , + ro->gateway, +0 , + &status, +NULL ); }if (!status) goto fail;
@@ -288,7 +293,7 @@else {if (spec->remote_endpoint_defined) - r->gateway = spec->remote_endpoint; + gateway = spec->remote_endpoint;else {msg (M_WARN ,PACKAGE_NAME " ROUTE: " PACKAGE_NAME " needs a gateway parameter for a --route option and no default was specified by either --route-gateway or --ifconfig options" );
@@ -298,35 +303,54 @@/* metric */ - r->metric_defined = false; - r->metric =0 ; + metric_defined = false; + metric =0 ;if (is_route_parm_defined (ro->metric)) { - r->metric =atoi (ro->metric); -if (r->metric <0 ) + metric =atoi (ro->metric); +if (metric <0 ) {msg (M_WARN ,PACKAGE_NAME " ROUTE: route metric for network %s (%s) must be >= 0" , ro->network, ro->metric); goto fail; } - r->metric_defined = true; + metric_defined = true; }else if (spec->default_metric_defined) { - r->metric = spec->default_metric; - r->metric_defined = true; + metric = spec->default_metric; + metric_defined = true; } - r->defined = true; +/* Now fill the corresponding route entries. */ -return true; +if (netmask != default_netmask && nb >1 ) +/* If we add individual hosts, then every IP of that host is added, +but if we add a whole subnet, then only consider the first IP, +presuming that all the IPs are in the same subnet. */ + nb =1 ; +/* Add a route for each one of the IPs found. */ +while (nb >0 && r < last_route) + { + nb--; + r->option = ro; + r->network = nets[nb]; + r->netmask = netmask; + r->gateway = gateway; + r->metric_defined = metric_defined; + r->metric = metric; + r->defined = true; + r++; + } + +return r; + fail:msg (M_WARN ,PACKAGE_NAME " ROUTE: failed to parse/resolve route for host/network: %s" , ro->network); - r->defined = false; -return false; +return NULL ; }void
@@ -438,22 +462,29 @@else rl->spec.remote_endpoint_defined = false; -if (!(opt->n >=0 && opt->n <= rl->capacity)) -msg (M_FATAL ,PACKAGE_NAME " ROUTE: (init) number of route options (%d) is greater than route list capacity (%d)" , opt->n, rl->capacity); -/* parse the routes from opt to rl */ { -int i, j =0 ; +int i; +struct route *cur_route = rl->routes; +struct route *last_route = &rl->routes[rl->capacity];for (i =0 ; i < opt->n; ++i) { -if (!init_route (&rl->routes[j], - &opt->routes[i], - &rl->spec)) - ret = false; +if (cur_route >= last_route) +msg (M_FATAL ,PACKAGE_NAME " ROUTE: (init) number of route options (%d) is greater than route list capacity (%d)" , opt->n, rl->capacity);else - ++j; + { +struct route *next_route + =init_route (cur_route, + last_route, + &opt->routes[i], + &rl->spec); +if (!next_route) + ret = false; +else + cur_route = next_route; + } } - rl->n = j; + rl->n = cur_route - rl->routes; }gc_free (&gc);
socket.c +58 -39
149 lines not on this page · raw message
socket.h +7 -0
@@ -450,6 +450,13 @@#define GETADDR_UPDATE_MANAGEMENT_STATE (1<<8)#define GETADDR_RANDOMIZE (1<<9) +#define MAX_IPS_PER_HOSTNAME 100 + +int getaddr_all (unsigned int flags, +in_addr_t *ret,int size, +const char *hostname, +int resolve_retry_seconds, +volatile int *signal_received); in_addr_t getaddr (unsigned int flags, const char *hostname, int resolve_retry_seconds,