aboutsummaryrefslogtreecommitdiff
path: root/src/openvpn/tun.c
diff options
context:
space:
mode:
authorSelva Nair2017-01-03 15:38:03 -0500
committerGert Doering2017-01-09 20:49:47 +0100
commit139cd1b14c57501bee36c1ec1dc5a037617ec29e (patch)
tree3142cd32cee8f10c0d1896dc24f86ac029cfa096 /src/openvpn/tun.c
parent6650911256b2e636b4a2d754cfe60e949f213f91 (diff)
downloadopenvpn-139cd1b14c57501bee36c1ec1dc5a037617ec29e.zip
openvpn-139cd1b14c57501bee36c1ec1dc5a037617ec29e.tar.gz
Always release dhcp address in close_tun() on Windows.
Also make sure --dhcp-pre-release results in not just dhcp_release() in open_tun() but a subsequent dhcp_renew() as well. Else dhcp transaction gets aborted as this call to release() happens after the adapter status is changed to connected. Fixes Trac #807 (but can't say the same for Trac #665 without knowing how to reproduce it) v2: Mark --dhcp-release as obsolete in manpage and option parser, and remove the unused dhcp_release variable. Enforce dhcp-renew with dhcp-pre-release while parsing the option instead of in open_tun(). Trac: #807 Signed-off-by: Selva Nair <selva.nair@gmail.com> Acked-by: Gert Doering <gert@greenie.muc.de> Message-Id: <1483475883-17450-1-git-send-email-selva.nair@gmail.com> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg13814.html Signed-off-by: Gert Doering <gert@greenie.muc.de> (cherry picked from commit db5b9b45508ea8f66ea80565279af3edd9300499)
Diffstat (limited to 'src/openvpn/tun.c')
-rw-r--r--src/openvpn/tun.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c
index f812844..ec9997e 100644
--- a/src/openvpn/tun.c
+++ b/src/openvpn/tun.c
@@ -6224,10 +6224,7 @@ close_tun(struct tuntap *tt)
}
#endif
- if (tt->options.dhcp_release)
- {
- dhcp_release(tt);
- }
+ dhcp_release(tt);
if (tt->hand != NULL)
{