summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGert Doering <gert@greenie.muc.de>2015-05-23 19:35:05 +0200
committerGert Doering <gert@greenie.muc.de>2015-05-23 20:31:39 +0200
commit7b285112d22f74c19dd5b1476ddbf1bd83339c84 (patch)
treef3ef02221b217e70ffb8ccdc07930f7fb3798feb
parent30256bede8f7ef6c82f1c2ed0d9f6c2177002926 (diff)
downloadopenvpn-7b285112d22f74c19dd5b1476ddbf1bd83339c84.tar.gz
openvpn-7b285112d22f74c19dd5b1476ddbf1bd83339c84.tar.xz
openvpn-7b285112d22f74c19dd5b1476ddbf1bd83339c84.zip
repair --dev null breakage caused by db950be85d37
"make check" self-test was broken after commit db950be85d37 due to do_ifconfig_setenv() not checking whether tt->did_ifconfig_setup was set (which isn't, for "dev null" type setups) Signed-off-by: Gert Doering <gert@greenie.muc.de> Acked-by: Steffan Karger <steffan@karger.me> Message-Id: <1432404098-29401-1-git-send-email-gert@greenie.muc.de> URL: http://article.gmane.org/gmane.network.openvpn.devel/9718 Signed-off-by: Gert Doering <gert@greenie.muc.de> (cherry picked from commit 970c4bd2e473f625699bd56db44c1970a9e10ed9)
-rw-r--r--src/openvpn/tun.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c
index 088527e..291d8c9 100644
--- a/src/openvpn/tun.c
+++ b/src/openvpn/tun.c
@@ -402,23 +402,27 @@ void
do_ifconfig_setenv (const struct tuntap *tt, struct env_set *es)
{
struct gc_arena gc = gc_new ();
- bool tun = is_tun_p2p (tt);
const char *ifconfig_local = print_in_addr_t (tt->local, 0, &gc);
const char *ifconfig_remote_netmask = print_in_addr_t (tt->remote_netmask, 0, &gc);
/*
* Set environmental variables with ifconfig parameters.
*/
- setenv_str (es, "ifconfig_local", ifconfig_local);
- if (tun)
+ if (tt->did_ifconfig_setup)
{
- setenv_str (es, "ifconfig_remote", ifconfig_remote_netmask);
- }
- else
- {
- const char *ifconfig_broadcast = print_in_addr_t (tt->broadcast, 0, &gc);
- setenv_str (es, "ifconfig_netmask", ifconfig_remote_netmask);
- setenv_str (es, "ifconfig_broadcast", ifconfig_broadcast);
+ bool tun = is_tun_p2p (tt);
+
+ setenv_str (es, "ifconfig_local", ifconfig_local);
+ if (tun)
+ {
+ setenv_str (es, "ifconfig_remote", ifconfig_remote_netmask);
+ }
+ else
+ {
+ const char *ifconfig_broadcast = print_in_addr_t (tt->broadcast, 0, &gc);
+ setenv_str (es, "ifconfig_netmask", ifconfig_remote_netmask);
+ setenv_str (es, "ifconfig_broadcast", ifconfig_broadcast);
+ }
}
if (tt->did_ifconfig_ipv6_setup)