]> git.ipfire.org Git - thirdparty/openvpn.git/commit
Set DNS Domain using iservice
authorSelva Nair <selva.nair@gmail.com>
Sat, 26 Sep 2020 02:04:46 +0000 (22:04 -0400)
committerGert Doering <gert@greenie.muc.de>
Mon, 28 Sep 2020 09:42:32 +0000 (11:42 +0200)
commit70882f3e40df1c70c553b8c22c747b468d5a0dc7
treefa5147d2ea6f5b59484bdaf9732bca6f97a37a50
parent7f7b05395c3eb634e198d12e212360958c3ca8fb
Set DNS Domain using iservice

Use wmic instead of directly editing the registry
as the former does not take full effect unless the dns
client service is restarted.

Editing the registry appears to work erratically depending
on whether its followed with a dchp renew or ipconfig /registerdns
etc.

DOMAIN-SEARCH is not handled here as wmic only supports
setting the global search list which will over-ride all
interface specific values.  Editing the registry directly
combined with a wmic command to reset the global SearchList
is an option that could be considered in a separate patch.

Trac # 1209, 1331

v2 changes
- Separate DNS domain setting from DNS server setting and call
  only once either during IPv4 processing or IPv6 processing
  if the former is not active. (file changed: tun.c)
- Null terminate domain and interface_name received from the
  client. (file changed: interactive.c)
  Its done using a const cast-away of msg in a limited scope.
  Not pretty, but alternatives are no better.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
Acked-by: Lev Stipakov <lstipakov@gmail.com>
Message-Id: <1601085886-10351-1-git-send-email-selva.nair@gmail.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg21097.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/tun.c
src/openvpnserv/interactive.c