From: "cron2 (Code Review)"
Date: Mon, 3 Nov 2025 13:08:48 +0000
In-Reply-To:
References:
Reply-To: gert@...1296..., arne-openvpn@...1227..., heiko@...515...,
openvpn-devel@lists.sourceforge.net, frank@...2641...,
lstipakov@...277...
Message-ID: <5954d2ac82210ec40535a4d97bb5a4ccc43aa126-EmailReplacePatchSet-HTML@...2715...>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Disposition: inline
Content-Type: multipart/alternative; boundary="MGKMmz+u+Xk="; charset=UTF-8
Subject: [Openvpn-devel] [M] Change in openvpn[release/2.6]: iservice: use
interface index with netsh
List-Id:
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
To: d12fk , plaisthos , flichtenheld , stipa
Cc: openvpn-devel
--MGKMmz+u+Xk=
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
cron2 has uploaded a new patch set (#2) to the change originally created by=
d12fk. ( http://gerrit.openvpn.net/c/openvpn/+/1337?usp=3Demail )
The following approvals got outdated and were removed:
Code-Review+2 by stipa
Change subject: iservice: use interface index with netsh
......................................................................
iservice: use interface index with netsh
We use the interface index with netsh everywhere else, so convert the
remaining invocations of netsh to index use as well.
Change-Id: I5cf45cfe0567da8fb5d47118a432a35b358f3809
Signed-off-by: Heiko Hund
Acked-by: Lev Stipakov
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1337
Message-Id: <20251103091525.22108-1-gert@...1296...>
Signed-off-by: Gert Doering
---
M src/openvpnserv/interactive.c
1 file changed, 50 insertions(+), 57 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/37/1337/2
diff --git a/src/openvpnserv/interactive.c b/src/openvpnserv/interactive.c
index c12d34f..b35005c 100644
--- a/src/openvpnserv/interactive.c
+++ b/src/openvpnserv/interactive.c
@@ -1035,16 +1035,16 @@
}
/**
- * Run the command: netsh interface $proto $action dns $if_name $addr [val=
idate=3Dno]
+ * Run the command: netsh interface $proto $action dns $if_index $addr [va=
lidate=3Dno]
* @param action "delete" or "add"
* @param proto "ipv6" or "ip"
- * @param if_name "name_of_interface"
+ * @param if_index index of the interface to modify DNS for
* @param addr IPv4 (for proto =3D ip) or IPv6 address as a string
*
* If addr is null and action =3D "delete" all addresses are deleted.
*/
static DWORD
-netsh_dns_cmd(const wchar_t *action, const wchar_t *proto, const wchar_t *=
if_name, const wchar_t *addr)
+netsh_dns_cmd(const wchar_t *action, const wchar_t *proto, int if_index, c=
onst wchar_t *addr)
{
DWORD err =3D 0;
int timeout =3D 30000; /* in msec */
@@ -1069,10 +1069,10 @@
/* cmd template:
* netsh interface $proto $action dns $if_name $addr [validate=3Dno]
*/
- const wchar_t *fmt =3D L"netsh interface %ls %ls dns \"%ls\" %ls";
+ const wchar_t *fmt =3D L"netsh interface %ls %ls dns %d %ls";
/* max cmdline length in wchars -- include room for worst case and som=
e */
- size_t ncmdline =3D wcslen(fmt) + wcslen(if_name) + wcslen(addr) + 32 =
+ 1;
+ size_t ncmdline =3D wcslen(fmt) + 11 /*if_index*/ + wcslen(addr) + 32 =
+ 1;
cmdline =3D malloc(ncmdline*sizeof(wchar_t));
if (!cmdline)
{
@@ -1080,7 +1080,7 @@
goto out;
}
- openvpn_swprintf(cmdline, ncmdline, fmt, proto, action, if_name, addr);
+ openvpn_swprintf(cmdline, ncmdline, fmt, proto, action, if_index, addr=
);
if (IsWindows7OrGreater())
{
@@ -1094,16 +1094,16 @@
}
/**
- * Run the command: netsh interface ip $action wins $if_name [static] $addr
+ * Run the command: netsh interface ip $action wins $if_index [static] $ad=
dr
* @param action "delete", "add" or "set"
- * @param if_name "name_of_interface"
+ * @param if_index index of the interface to modify WINS for
* @param addr IPv4 address as a string
*
* If addr is null and action =3D "delete" all addresses are deleted.
* if action =3D "set" then "static" is added before $addr
*/
static DWORD
-netsh_wins_cmd(const wchar_t *action, const wchar_t *if_name, const wchar_=
t *addr)
+netsh_wins_cmd(const wchar_t *action, int if_index, const wchar_t *addr)
{
DWORD err =3D 0;
int timeout =3D 30000; /* in msec */
@@ -1129,11 +1129,11 @@
/* cmd template:
* netsh interface ip $action wins $if_name $static $addr
*/
- const wchar_t *fmt =3D L"netsh interface ip %ls wins \"%ls\" %ls %ls";
+ const wchar_t *fmt =3D L"netsh interface ip %ls wins %d %ls %ls";
/* max cmdline length in wchars -- include room for worst case and som=
e */
- size_t ncmdline =3D wcslen(fmt) + wcslen(if_name) + wcslen(action) + w=
cslen(addr)
- +wcslen(addr_static) + 32 + 1;
+ size_t ncmdline =3D wcslen(fmt) + 11 /*if_index*/ + wcslen(action) + w=
cslen(addr)
+ + wcslen(addr_static) + 32 + 1;
cmdline =3D malloc(ncmdline * sizeof(wchar_t));
if (!cmdline)
{
@@ -1141,7 +1141,7 @@
goto out;
}
- openvpn_swprintf(cmdline, ncmdline, fmt, action, if_name, addr_static,=
addr);
+ openvpn_swprintf(cmdline, ncmdline, fmt, action, if_index, addr_static=
, addr);
err =3D ExecCommand(argv0, cmdline, timeout);
@@ -1184,18 +1184,18 @@
/* Delete all IPv4 or IPv6 dns servers for an interface */
static DWORD
-DeleteDNS(short family, wchar_t *if_name)
+DeleteDNS(short family, int if_index)
{
wchar_t *proto =3D (family =3D=3D AF_INET6) ? L"ipv6" : L"ip";
- return netsh_dns_cmd(L"delete", proto, if_name, NULL);
+ return netsh_dns_cmd(L"delete", proto, if_index, NULL);
}
/* Add an IPv4 or IPv6 dns server to an interface */
static DWORD
-AddDNS(short family, wchar_t *if_name, wchar_t *addr)
+AddDNS(short family, int if_index, wchar_t *addr)
{
wchar_t *proto =3D (family =3D=3D AF_INET6) ? L"ipv6" : L"ip";
- return netsh_dns_cmd(L"add", proto, if_name, addr);
+ return netsh_dns_cmd(L"add", proto, if_index, addr);
}
static BOOL
@@ -1295,12 +1295,12 @@
*/
if (addr_len > 0 || msg->header.type =3D=3D msg_del_dns_cfg)
{
- err =3D DeleteDNS(msg->family, wide_name);
+ err =3D DeleteDNS(msg->family, msg->iface.index);
if (err)
{
goto out;
}
- free(RemoveListItem(&(*lists)[undo_type], CmpWString, wide_name));
+ free(RemoveListItem(&(*lists)[undo_type], CmpAny, NULL));
}
if (msg->header.type =3D=3D msg_del_dns_cfg)
@@ -1323,7 +1323,7 @@
{
RtlIpv4AddressToStringW(&msg->addr[i].ipv4, addr);
}
- err =3D AddDNS(msg->family, wide_name, addr);
+ err =3D AddDNS(msg->family, msg->iface.index, addr);
if (i =3D=3D 0 && err)
{
goto out;
@@ -1337,11 +1337,15 @@
if (msg->addr_len > 0)
{
- wchar_t *tmp_name =3D _wcsdup(wide_name);
- if (!tmp_name || AddListItem(&(*lists)[undo_type], tmp_name))
+ int *tmp_index =3D malloc(sizeof(msg->iface.index));
+ if (tmp_index)
{
- free(tmp_name);
- DeleteDNS(msg->family, wide_name);
+ *tmp_index =3D msg->iface.index;
+ }
+ if (!tmp_index || AddListItem(&(*lists)[undo_type], tmp_index))
+ {
+ free(tmp_index);
+ DeleteDNS(msg->family, msg->iface.index);
err =3D ERROR_OUTOFMEMORY;
goto out;
}
@@ -1360,7 +1364,7 @@
static DWORD
HandleWINSConfigMessage(const wins_cfg_message_t *msg, undo_lists_t *lists)
{
- DWORD err =3D 0;
+ DWORD err =3D NO_ERROR;
wchar_t addr[16]; /* large enough to hold string representation of an =
ipv4 */
int addr_len =3D msg->addr_len;
@@ -1370,37 +1374,25 @@
addr_len =3D _countof(msg->addr);
}
- if (!msg->iface.name[0]) /* interface name is required */
+ if (!msg->iface.index) /* interface index is required */
{
return ERROR_MESSAGE_DATA;
}
- /* use a non-const reference with limited scope to enforce null-termin=
ation of strings from client */
- {
- wins_cfg_message_t *msgptr =3D (wins_cfg_message_t *)msg;
- msgptr->iface.name[_countof(msg->iface.name) - 1] =3D '\0';
- }
-
- wchar_t *wide_name =3D utf8to16(msg->iface.name); /* utf8 to wide-char=
*/
- if (!wide_name)
- {
- return ERROR_OUTOFMEMORY;
- }
-
/* We delete all current addresses before adding any
* OR if the message type is del_wins_cfg
*/
if (addr_len > 0 || msg->header.type =3D=3D msg_del_wins_cfg)
{
- err =3D netsh_wins_cmd(L"delete", wide_name, NULL);
+ err =3D netsh_wins_cmd(L"delete", msg->iface.index, NULL);
if (err)
{
goto out;
}
- free(RemoveListItem(&(*lists)[undo_wins], CmpWString, wide_name));
+ free(RemoveListItem(&(*lists)[undo_wins], CmpAny, NULL));
}
- if (msg->header.type =3D=3D msg_del_wins_cfg)
+ if (addr_len =3D=3D 0 || msg->header.type =3D=3D msg_del_wins_cfg)
{
goto out; /* job done */
}
@@ -1408,7 +1400,7 @@
for (int i =3D 0; i < addr_len; ++i)
{
RtlIpv4AddressToStringW(&msg->addr[i].ipv4, addr);
- err =3D netsh_wins_cmd(i =3D=3D 0 ? L"set" : L"add", wide_name, ad=
dr);
+ err =3D netsh_wins_cmd(i =3D=3D 0 ? L"set" : L"add", msg->iface.in=
dex, addr);
if (i =3D=3D 0 && err)
{
goto out;
@@ -1418,22 +1410,23 @@
*/
}
- err =3D 0;
-
- if (addr_len > 0)
+ int *if_index =3D malloc(sizeof(msg->iface.index));
+ if (if_index)
{
- wchar_t *tmp_name =3D _wcsdup(wide_name);
- if (!tmp_name || AddListItem(&(*lists)[undo_wins], tmp_name))
- {
- free(tmp_name);
- netsh_wins_cmd(L"delete", wide_name, NULL);
- err =3D ERROR_OUTOFMEMORY;
- goto out;
- }
+ *if_index =3D msg->iface.index;
}
+ if (!if_index || AddListItem(&(*lists)[undo_wins], if_index))
+ {
+ free(if_index);
+ netsh_wins_cmd(L"delete", msg->iface.index, NULL);
+ err =3D ERROR_OUTOFMEMORY;
+ goto out;
+ }
+
+ err =3D 0;
+
out:
- free(wide_name);
return err;
}
@@ -1734,15 +1727,15 @@
break;
=20
case undo_dns4:
- DeleteDNS(AF_INET, item->data);
+ DeleteDNS(AF_INET, *(int *)item->data);
break;
case undo_dns6:
- DeleteDNS(AF_INET6, item->data);
+ DeleteDNS(AF_INET6, *(int *)item->data);
break;
case undo_wins:
- netsh_wins_cmd(L"delete", item->data, NULL);
+ netsh_wins_cmd(L"delete", *(int *)item->data, NULL);
break;
case undo_domain:
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1337?usp=3Demail
To unsubscribe, or for help writing mail filters, visit http://gerrit.openv=
pn.net/settings?usp=3Demail
Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: release/2.6
Gerrit-Change-Id: I5cf45cfe0567da8fb5d47118a432a35b358f3809
Gerrit-Change-Number: 1337
Gerrit-PatchSet: 2
Gerrit-Owner: d12fk
Gerrit-Reviewer: flichtenheld
Gerrit-Reviewer: plaisthos
Gerrit-Reviewer: stipa
Gerrit-CC: openvpn-devel
--MGKMmz+u+Xk=
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
cron2 upl=
oaded patch set #2 to the change originally created by d12fk.
<=
p>View C=
hange
The following approvals got outdated and were removed:
Code-Review+2 by stipa
iservice: use interface index with =
netsh
We use the interface index with netsh everywhere else, so conv=
ert the
remaining invocations of netsh to index use as well.
Chan=
ge-Id: I5cf45cfe0567da8fb5d47118a432a35b358f3809
Signed-off-by: Heiko Hu=
nd <heiko@...2662...>
Acked-by: Lev Stipakov <lstipakov@...1354...=
..>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1337
Messag=
e-Id: <20251103091525.22108-1-gert@...1296...>
Signed-off-by: Gert=
Doering <gert@...1296...>
---
M src/openvpnserv/interactive.c<=
br>1 file changed, 50 insertions(+), 57 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/37/1337/2=
diff --git a/src/openvpnserv/interactive.c b/src/openvpnserv/inter=
active.c
index c12d34f..b35005c 100644
--- =
a/src/openvpnserv/interactive.c
+++ b/src/openvpnserv/inter=
active.c
@@ -1035,16 +1035,16 @@
}<=
br>
/**
- * Run the command: netsh interface $proto $action dns $if_name $=
addr [validate=3Dno]
=
+ * Run the command: netsh interface $proto $action dns $if_index $addr [va=
lidate=3Dno]
* @param action "delete" or =
"add"
* @param proto "ipv6" or=
"ip"
- * @pa=
ram if_name "name_of_interface"
+ * @param if_index index of the interface t=
o modify DNS for
* @param addr IPv4 (for proto =
=3D ip) or IPv6 address as a string
*
*=
If addr is null and action =3D "delete" all addresses are delete=
d.
*/
static DWORD
-netsh_dns_cmd(const wchar_t *action, const =
wchar_t *proto, const wchar_t *if_name, const wchar_t *addr)
+netsh_dns_cmd(const wchar_t *actio=
n, const wchar_t *proto, int if_index, const wchar_t *addr)
{
DWORD err =3D 0;
int timeout =
=3D 30000; /* in msec */
@@ -1069,10 +1069,10 @@
=
/* cmd template:
* netsh interface $proto =
$action dns $if_name $addr [validate=3Dno]
*/<=
br>- const wchar_t *fmt =3D L&=
quot;netsh interface %ls %ls dns \"%ls\" %ls";
+ const wchar_t *fmt =3D L"=
;netsh interface %ls %ls dns %d %ls";
/* max cmdline length in wchars -- include room for worst case and s=
ome */
- size_t ncmd=
line =3D wcslen(fmt) + wcslen(if_name) + wcslen(addr) + 32 + 1;
<=
span style=3D"color: hsl(120, 100%, 40%);">+ size_t ncmdline =3D wcslen(=
fmt) + 11 /*if_index*/ + wcslen(addr) + 32 + 1;
cmdlin=
e =3D malloc(ncmdline*sizeof(wchar_t));
if (!cmdline)<=
/span>
{
@@ -1080,7 +1080,7 @@
goto out;
}
- openvpn_swprintf(cmdline, ncmdl=
ine, fmt, proto, action, if_name, addr);
+ openvpn_swprintf(cmdline, ncmdline, fmt, proto, ac=
tion, if_index, addr);
if (IsWindows=
7OrGreater())
{
@@ -1094,16 +1094,16 @=
@
}
/**
- * Run the command: netsh interface i=
p $action wins $if_name [static] $addr
+ * Run the command: netsh interface ip $action wins $if_=
index [static] $addr
* @param action "delete&q=
uot;, "add" or "set"
- * @param if_name "name_of_interface"
+ * @param if_index =
index of the interface to modify WINS for
* @param addr =
IPv4 address as a string
*
* If =
addr is null and action =3D "delete" all addresses are deleted.=
span>
* if action =3D "set" then "static" is=
added before $addr
*/
static DWORD
-netsh_wins_cmd(const wchar=
_t *action, const wchar_t *if_name, const wchar_t *addr)
+netsh_wins_cmd(const wchar_t *action, =
int if_index, const wchar_t *addr)
{
=
DWORD err =3D 0;
int timeout =3D 30000; /* in msec */<=
/span>
@@ -1129,11 +1129,11 @@
/* cmd templat=
e:
* netsh interface ip $action wins $if_name $static=
$addr
*/
- const wchar_t *fmt =3D L"netsh interface ip %ls wins \&q=
uot;%ls\" %ls %ls";
+ const wchar_t *fmt =3D L"netsh interface ip %ls wins %d =
%ls %ls";
/* max cmdline length=
in wchars -- include room for worst case and some */
- size_t ncmdline =3D wcslen(fmt) + wcsle=
n(if_name) + wcslen(action) + wcslen(addr)
- +wcslen(addr_static) + 32 + 1;=
span>
+ size_t ncmdline =
=3D wcslen(fmt) + 11 /*if_index*/ + wcslen(action) + wcslen(addr)
+ + wcsle=
n(addr_static) + 32 + 1;
cmdline =3D malloc(ncmdline *=
sizeof(wchar_t));
if (!cmdline)
=
{
@@ -1141,7 +1141,7 @@
goto out;<=
/span>
}
- openvpn_swprintf(cmdline, ncmdline, fmt, action, if_=
name, addr_static, addr);
+ openvpn_swprintf(cmdline, ncmdline, fmt, action, if_index, addr_s=
tatic, addr);
err =3D ExecCommand(ar=
gv0, cmdline, timeout);
@@ -1184,18 +1184=
,18 @@
/* Delete all IPv4 or IPv6 dns se=
rvers for an interface */
static DWORD
-DeleteDNS(short family, wchar_t *if_name)=
+DeleteDNS(short fam=
ily, int if_index)
{
wchar_t *proto =
=3D (family =3D=3D AF_INET6) ? L"ipv6" : L"ip";<=
br>- return netsh_dns_cmd(L&qu=
ot;delete", proto, if_name, NULL);
+ return netsh_dns_cmd(L"delete", proto, if=
_index, NULL);
}
/* Add=
an IPv4 or IPv6 dns server to an interface */
static DWOR=
D
-AddDNS(short family,=
wchar_t *if_name, wchar_t *addr)
+AddDNS(short family, int if_index, wchar_t *addr)
<=
span> {
wchar_t *proto =3D (family =3D=3D AF_INET6) ? =
L"ipv6" : L"ip";
- return netsh_dns_cmd(L"add", proto, if_name, a=
ddr);
+ return net=
sh_dns_cmd(L"add", proto, if_index, addr);
}
static BOOL
@@ -1295,12 +12=
95,12 @@
*/
if (addr_len > 0 =
|| msg->header.type =3D=3D msg_del_dns_cfg)
{
- err =3D DeleteDNS(m=
sg->family, wide_name);
+ err =3D DeleteDNS(msg->family, msg->iface.index);
if (err)
{
=
goto out;
}
- free(RemoveListItem(&(*lists)[undo_ty=
pe], CmpWString, wide_name));
+ free(RemoveListItem(&(*lists)[undo_type], CmpAny, NUL=
L));
}
if (msg-=
>header.type =3D=3D msg_del_dns_cfg)
@@ -1323,7 +1323,7 =
@@
{
RtlIpv4AddressTo=
StringW(&msg->addr[i].ipv4, addr);
}=
- err =3D AddDNS(msg-&=
gt;family, wide_name, addr);
+ err =3D AddDNS(msg->family, msg->iface.index, addr);=
if (i =3D=3D 0 && err)
=
{
goto out;
@@ -1337,11=
+1337,15 @@
if (msg->addr_len &g=
t; 0)
{
- wchar_t *tmp_name =3D _wcsdup(wide_name);
- if (!tmp_name || AddListItem(&am=
p;(*lists)[undo_type], tmp_name))
+ int *tmp_index =3D malloc(sizeof(msg->iface.index)=
);
+ if (tmp_i=
ndex)
{
- free(tmp_name);
- DeleteDNS(msg->family, wide_name);+ *tmp_index =3D m=
sg->iface.index;
+=
}
+ if=
(!tmp_index || AddListItem(&(*lists)[undo_type], tmp_index))
+ {
+ free(tmp_index);
=
+ DeleteDNS(msg->=
family, msg->iface.index);
err =3D ERROR_OU=
TOFMEMORY;
goto out;
=
}
@@ -1360,7 +1364,7 @@
static DWORD
HandleWINSConfigMessage(const wins_cfg_message_t *msg, undo_lis=
ts_t *lists)
{
- DWORD err =3D 0;
+ DWORD err =3D NO_ERROR;
wchar_t addr[16=
]; /* large enough to hold string representation of an ipv4 */
int addr_len =3D msg->addr_len;
@@ -1370,37 +1374,25 @@
addr_len =3D _countof(m=
sg->addr);
}
- if (!msg->iface.name[0]) /* interfa=
ce name is required */
+ if (!msg->iface.index) /* interface index is required */ {
return ERROR_MESSAGE_DATA; }
- /* use a non-const reference with limited scope to enforce n=
ull-termination of strings from client */
- {
- wins_cfg_message_t *msgptr =3D (wins_cfg_message_t *)msg;
- msgptr->iface.na=
me[_countof(msg->iface.name) - 1] =3D '\0';
- }
-
- =
wchar_t *wide_name =3D utf8to16(msg->iface.name); /* utf8 to wide-char *=
/
- if (!wide_name)<=
/span>
- {
- return ERROR_OUTOFMEMORY;
- }
-
/* We delete all cur=
rent addresses before adding any
* OR if the message =
type is del_wins_cfg
*/
if (addr=
_len > 0 || msg->header.type =3D=3D msg_del_wins_cfg)
{
- err =
=3D netsh_wins_cmd(L"delete", wide_name, NULL);
+ err =3D netsh_wins_cmd(L"=
;delete", msg->iface.index, NULL);
if (err=
)
{
goto out;<=
br> }
- =
free(RemoveListItem(&(*lists)[undo_wins], CmpWString, wide_name))=
;
+ free(Remov=
eListItem(&(*lists)[undo_wins], CmpAny, NULL));
}<=
/span>
- =
if (msg->header.type =3D=3D msg_del_wins_cfg)
+ if (addr_len =3D=3D 0 || msg->header.ty=
pe =3D=3D msg_del_wins_cfg)
{
=
goto out; /* job done */
}
@@ -1408,=
7 +1400,7 @@
for (int i =3D 0; i < addr_len; ++i)=
span>
{
RtlIpv4AddressToStringW(&=
;msg->addr[i].ipv4, addr);
- err =3D netsh_wins_cmd(i =3D=3D 0 ? L"set" : L&qu=
ot;add", wide_name, addr);
+ err =3D netsh_wins_cmd(i =3D=3D 0 ? L"set" : =
L"add", msg->iface.index, addr);
if (=
i =3D=3D 0 && err)
{
=
goto out;
@@ -1418,22 +1410,23 @@
=
*/
}
- err =3D 0;
-
- if (addr_len > 0)
+ int *if_index =3D malloc(sizeof(msg->iface.index));<=
br>+ if (if_index)
{
- =
wchar_t *tmp_name =3D _wcsdup(wide_name);
- if (!tmp_name || AddListItem(&(*lists)[undo=
_wins], tmp_name))
- =
{
- fre=
e(tmp_name);
- =
netsh_wins_cmd(L"delete", wide_name, NULL);
- err =3D ERROR_OUTOFMEMORY;=
span>
- goto out;=
span>
- }
+ *if_index =3D msg->ifa=
ce.index;
}
+ if (!if_index || AddListItem(&(*list=
s)[undo_wins], if_index))
+ {
+ =
free(if_index);
+ =
netsh_wins_cmd(L"delete", msg->iface.index, NULL);<=
br>+ err =3D ERROR_OUTOF=
MEMORY;
+ goto=
out;
+ }+
+ err =3D 0;
+
out:
- free(wide_name);
return er=
r;
}
@@ -1734,15 +1727,1=
5 @@
break;
case undo_dns4:
- DeleteDNS(AF_INET, item->data);=
span>
+ D=
eleteDNS(AF_INET, *(int *)item->data);
=
break;
case undo_dns=
6:
- =
DeleteDNS(AF_INET6, item->data);
+ DeleteDNS(AF_INET6, *(int *)item->d=
ata);
break;
<=
br> case undo_wins:
- netsh_wins_cmd(L"delete",=
item->data, NULL);
+ netsh_wins_cmd(L"delete", *(int *)item->=
;data, NULL);
break;
=
case undo_domain:
=
To view, visit change 1337. To unsubscribe, or for help writing ma=
il filters, visit settings.
=
div>
Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: release/2.6
Gerrit-Change-Id: I5cf45cfe0567da8fb5d47118a43=
2a35b358f3809
Gerrit-Change-Number: 1337
Gerrit-PatchSet: 2
Gerrit-Owner: d12fk <heiko@...515...> =
div>
Gerrit-Reviewer: flichtenheld <frank@...2716...=
1...>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...=
.1227...>
Gerrit-Reviewer: stipa <lstipakov@...277...=
>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...=
ts.sourceforge.net>
=
--MGKMmz+u+Xk=--