References: <1483152307-15687-1-git-send-email-selva.nair@...277...> From: debbie10t Message-ID: <6910ed3b-4620-ec1a-0079-4bcfdf565627@...277...> Date: Sun, 1 Jan 2017 13:22:37 +0000 MIME-Version: 1.0 In-Reply-To: <1483152307-15687-1-git-send-email-selva.nair@...277...> Subject: Re: [Openvpn-devel] [PATCH] Always release dhcp address in close_tun() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit To: openvpn-devel@lists.sourceforge.net Should this be applied to 2.4.0 or 2.5_gitmaster ? thanks On 31/12/16 02:45, selva.nair@...277... wrote: > From: Selva Nair > > 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 > --- > 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) > { >