From: Selva Nair <selva.n...@gmail.com>

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.

Alternatively, the undocumented --dhcp-pre-release may be removed.

Fixes Trac #807 (but can't say the same for Trac #665 without knowing
how to reproduce it)

Signed-off-by: Selva Nair <selva.n...@gmail.com>
---
 src/openvpn/tun.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c
index f812844..31fcd67 100644
--- a/src/openvpn/tun.c
+++ b/src/openvpn/tun.c
@@ -6056,6 +6056,7 @@ open_tun(const char *dev, const char *dev_type, const 
char *dev_node, struct tun
             if (tt->options.dhcp_pre_release)
             {
                 dhcp_release(tt);
+                dhcp_renew(tt);
             }
             if (tt->options.dhcp_renew)
             {
@@ -6224,10 +6225,7 @@ close_tun(struct tuntap *tt)
         }
 #endif
 
-        if (tt->options.dhcp_release)
-        {
-            dhcp_release(tt);
-        }
+        dhcp_release(tt);
 
         if (tt->hand != NULL)
         {
-- 
2.1.4


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to