[Openvpn-devel,3/4] Use netioapi instead of netsh to set mtu

Message ID 20190401112140.13212-3-cschenk@mail.uni-paderborn.de
State Superseded
Headers show
Series
  • [Openvpn-devel,1/4] Setting adapter mtu on windows systems
Related show

Commit Message

Christopher Schenk April 1, 2019, 11:21 a.m.
---
 src/openvpn/tun.c             | 68 +++++++++++++++++++----------------
 src/openvpnserv/interactive.c | 44 +++++------------------
 2 files changed, 46 insertions(+), 66 deletions(-)

Comments

Selva Nair April 1, 2019, 3:56 p.m. | #1
Hi,

On Mon, Apr 1, 2019 at 7:22 AM Christopher Schenk <
cschenk@mail.uni-paderborn.de> wrote:

> ---
>  src/openvpn/tun.c             | 68 +++++++++++++++++++----------------
>  src/openvpnserv/interactive.c | 44 +++++------------------
>  2 files changed, 46 insertions(+), 66 deletions(-)
>
> diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c
> index b0230a7c..9fe8444f 100644
> --- a/src/openvpn/tun.c
> +++ b/src/openvpn/tun.c
> @@ -69,10 +69,8 @@ static void netsh_ifconfig(const struct tuntap_options
> *to,
>                             const in_addr_t netmask,
>                             const unsigned int flags);
>
> -static void netsh_set_mtu_ipv4(const char *flex_name,
> -                               const int mtu);
> -
> -static void netsh_set_mtu_ipv6(const char *flex_name,
> +static void windows_set_mtu(const int iface_indey,
> +                                                               short
> family,
>                                 const int mtu);
>

Do not use tabs, use 4 whitespace characters for indent
as in the rest of the code.


>
>  static void netsh_set_dns6_servers(const struct in6_addr *addr_list,
> @@ -1064,7 +1062,7 @@ do_ifconfig_ipv6(struct tuntap *tt, const char
> *ifname, int tun_mtu,
>          netsh_command(&argv, 4, M_FATAL);
>          /* set ipv6 dns servers if any are specified */
>          netsh_set_dns6_servers(tt->options.dns6, tt->options.dns6_len,
> ifname);
> -        netsh_set_mtu_ipv6(ifname, tun_mtu);
> +               windows_set_mtu(tt->adapter_index, AF_INET6, tun_mtu);
>

Code indentation is not "correct" in many places like this -- see
remarks in my response to commit 4.


>      }
>
>      /* explicit route needed */
> @@ -1464,7 +1462,7 @@ do_ifconfig_ipv4(struct tuntap *tt, const char
> *ifname, int tun_mtu,
>                 }
>                 else
>                 {
> -                       netsh_set_mtu_ipv4(ifname, tun_mtu);
> +                       windows_set_mtu(tt->adapter_index, AF_INET,
> tun_mtu);
>                 }
>      }
>
> @@ -5309,35 +5307,45 @@ out:
>  }
>
>  static void
> -netsh_set_mtu_ipv4(const char *flex_name,
> -                   const int mtu)
> -{
> -       struct argv argv = argv_new();
> -       argv_printf(&argv, "%s%sc interface ipv4 set subinterface %s mtu =
> %d store=active",
> -               get_win_sys_path(),
> -               NETSH_PATH_SUFFIX,
> -               flex_name,
> -               mtu);
> -
> -       netsh_command(&argv, 3, M_WARN);
> -       argv_reset(&argv);
> -}
> -
> -static void
> -netsh_set_mtu_ipv6(const char *flex_name,
> +windows_set_mtu(const int iface_index, const short family,
>         const int mtu)
>
 {
> -       struct argv argv = argv_new();
> -       argv_printf(&argv, "%s%sc interface ipv6 set subinterface %s mtu =
> %d store=active",
> -               get_win_sys_path(),
> -               NETSH_PATH_SUFFIX,
> -               flex_name,
> -               mtu);
> +       DWORD err = 0;
> +       struct gc_arena gc = gc_new();
> +       MIB_IPINTERFACE_ROW row;
> +       InitializeIpInterfaceEntry(&row);
> +       row.Family = family;
> +       row.InterfaceIndex = iface_index;
> +       row.NlMtu = mtu;
>
> -       netsh_command(&argv, 3, M_WARN);
> -       argv_reset(&argv);
> +       err = SetIpInterfaceEntry(&row);
>

I think this has the potential to reset other interface parameters
edited elsewhere (or set by the user) to the default values. The
right approach would be to get the current state using
GetIpInterfaceEntry(&row) and then modify only the mtu before
calling SetIpInterfaceEntry().

See how its done in block_dns.c or consult the IP Helper docs.

Same in interactive.c

+       if (family == AF_INET)
> +       {
> +               if (err != NO_ERROR)
> +               {
> +                       msg(M_WARN, "TUN: Setting IPv4 mtu failed: %s
> [status=%u if_index=%d]",
> +                               strerror_win32(err, &gc), err,
> iface_index);
> +               }
> +               else
> +               {
> +                       msg(M_INFO, "Successfully set IPv4 mtu on
> interface %d", iface_index);
> +               }
> +       }
> +       else if (family == AF_INET6)
> +       {
> +               if (err != NO_ERROR)
> +               {
> +                       msg(M_WARN, "TUN: Setting IPv6 mtu failed: %s
> [status=%u if_index=%d]",
> +                               strerror_win32(err, &gc), err,
> iface_index);
> +               }
> +               else
> +               {
> +                       msg(M_INFO, "Successfully set IPv6 mtu on
> interface %d", iface_index);
> +               }
> +       }
>  }
>
> +
>  /*
>   * Return a TAP name for netsh commands.
>   */
> diff --git a/src/openvpnserv/interactive.c b/src/openvpnserv/interactive.c
> index 31e4afa0..6e6a63fe 100644
> --- a/src/openvpnserv/interactive.c
> +++ b/src/openvpnserv/interactive.c
> @@ -33,6 +33,7 @@
>  #include <sddl.h>
>  #include <shellapi.h>
>  #include <mstcpip.h>
> +#include <netioapi.h>
>
>
There should be no need to include this header directly. Instead let
the main IP Helper API header (iphlpapi.h) include it correctly.
The latter is already included both in tun.c and interactive.c


>  #ifdef HAVE_VERSIONHELPERS_H
>  #include <versionhelpers.h>
> @@ -1202,42 +1203,13 @@ static DWORD
>  HandleMTUMessage(const set_mtu_message_t *mtu)
>  {
>         DWORD err = 0;
> -       DWORD timeout = 5000; /* in milli seconds */
> -       wchar_t argv0[MAX_PATH];
> -
> -       /* Path of netsh */
> -       swprintf(argv0, _countof(argv0), L"%s\\%s", get_win_sys_path(),
> L"netsh.exe");
> -       argv0[_countof(argv0) - 1] = L'\0';
> -
> -       /* cmd template:
> -        * netsh interface $family set subinterface "$if_name" mtu=$mtu
> -        */
> -       const wchar_t *fmt;
> -       if (mtu->family == AF_INET)
> -       {
> -               fmt = L"netsh interface ipv4 set subinterface \"%d\" mtu=
> %d";
> -       }
> -       else if (mtu->family == AF_INET6)
> -       {
> -               fmt = L"netsh interface ipv6 set subinterface \"%d\" mtu=
> %d";
> -       }
> -
> -       /* max cmdline length in wchars -- include room for if index:
> -        * 20 chars for two 32 bit int in decimal and +1 for NUL
> -        */
> -       size_t ncmdline = wcslen(fmt) + 20 + 1;
> -       wchar_t *cmdline = malloc(ncmdline * sizeof(wchar_t));
> -       if (!cmdline)
> -       {
> -               err = ERROR_OUTOFMEMORY;
> -               return err;
> -       }
> -
> -       openvpn_sntprintf(cmdline, ncmdline, fmt, mtu->iface.index,
> mtu->mtu);
> -
> -       err = ExecCommand(argv0, cmdline, timeout);
> -
> -       free(cmdline);
> +       MIB_IPINTERFACE_ROW row;
> +       InitializeIpInterfaceEntry(&row);
> +       row.Family = mtu->family;
> +       row.InterfaceIndex = mtu->iface.index;
> +       row.NlMtu = mtu->mtu;
> +
> +       err = SetIpInterfaceEntry(&row);
>

See the remark above.


>         return err;
>  }
>
>
Selva
<div dir="ltr"><div>Hi,<br><br></div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Apr 1, 2019 at 7:22 AM Christopher Schenk &lt;<a href="mailto:cschenk@mail.uni-paderborn.de" target="_blank">cschenk@mail.uni-paderborn.de</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">---<br>
 src/openvpn/tun.c             | 68 +++++++++++++++++++----------------<br>
 src/openvpnserv/interactive.c | 44 +++++------------------<br>
 2 files changed, 46 insertions(+), 66 deletions(-)<br>
<br>
diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c<br>
index b0230a7c..9fe8444f 100644<br>
--- a/src/openvpn/tun.c<br>
+++ b/src/openvpn/tun.c<br>
@@ -69,10 +69,8 @@ static void netsh_ifconfig(const struct tuntap_options *to,<br>
                            const in_addr_t netmask,<br>
                            const unsigned int flags);<br>
<br>
-static void netsh_set_mtu_ipv4(const char *flex_name,<br>
-                               const int mtu);<br>
-<br>
-static void netsh_set_mtu_ipv6(const char *flex_name,<br>
+static void windows_set_mtu(const int iface_indey,<br>
+                                                               short family,<br>
                                const int mtu);<br></blockquote><div><br></div><div>Do not use tabs, use 4 whitespace characters for indent<br>as in the rest of the code.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
 static void netsh_set_dns6_servers(const struct in6_addr *addr_list,<br>
@@ -1064,7 +1062,7 @@ do_ifconfig_ipv6(struct tuntap *tt, const char *ifname, int tun_mtu,<br>
         netsh_command(&amp;argv, 4, M_FATAL);<br>
         /* set ipv6 dns servers if any are specified */<br>
         netsh_set_dns6_servers(tt-&gt;options.dns6, tt-&gt;options.dns6_len, ifname);<br>
-        netsh_set_mtu_ipv6(ifname, tun_mtu);<br>
+               windows_set_mtu(tt-&gt;adapter_index, AF_INET6, tun_mtu);<br></blockquote><div><br></div><div>Code indentation is not &quot;correct&quot; in many places like this -- see <br>remarks in my response to commit 4.<br></div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
     }<br>
<br>
     /* explicit route needed */<br>
@@ -1464,7 +1462,7 @@ do_ifconfig_ipv4(struct tuntap *tt, const char *ifname, int tun_mtu,<br>
                }<br>
                else<br>
                {<br>
-                       netsh_set_mtu_ipv4(ifname, tun_mtu);<br>
+                       windows_set_mtu(tt-&gt;adapter_index, AF_INET, tun_mtu);<br>
                }<br>
     }<br>
<br>
@@ -5309,35 +5307,45 @@ out:<br>
 }<br>
<br>
 static void<br>
-netsh_set_mtu_ipv4(const char *flex_name,<br>
-                   const int mtu)<br>
-{<br>
-       struct argv argv = argv_new();<br>
-       argv_printf(&amp;argv, &quot;%s%sc interface ipv4 set subinterface %s mtu = %d store=active&quot;,<br>
-               get_win_sys_path(),<br>
-               NETSH_PATH_SUFFIX,<br>
-               flex_name,<br>
-               mtu);<br>
-<br>
-       netsh_command(&amp;argv, 3, M_WARN);<br>
-       argv_reset(&amp;argv);<br>
-}<br>
-<br>
-static void<br>
-netsh_set_mtu_ipv6(const char *flex_name,<br>
+windows_set_mtu(const int iface_index, const short family,<br>
        const int mtu) <br></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
 {<br>
-       struct argv argv = argv_new();<br>
-       argv_printf(&amp;argv, &quot;%s%sc interface ipv6 set subinterface %s mtu = %d store=active&quot;,<br>
-               get_win_sys_path(),<br>
-               NETSH_PATH_SUFFIX,<br>
-               flex_name,<br>
-               mtu);<br>
+       DWORD err = 0;<br>
+       struct gc_arena gc = gc_new();<br>
+       MIB_IPINTERFACE_ROW row;<br>
+       InitializeIpInterfaceEntry(&amp;row);<br>
+       row.Family = family;<br>
+       row.InterfaceIndex = iface_index;<br>
+       row.NlMtu = mtu;<br>
<br>
-       netsh_command(&amp;argv, 3, M_WARN);<br>
-       argv_reset(&amp;argv);<br>
+       err = SetIpInterfaceEntry(&amp;row);<br></blockquote><div><br></div><div>I think this has the potential to reset other interface parameters<br>edited elsewhere (or set by the user) to the default values. The<br>right approach would be to get the current state using<br>GetIpInterfaceEntry(&amp;row) and then modify only the mtu before<br>calling SetIpInterfaceEntry().<br><br>See how its done in block_dns.c or consult the IP Helper docs.<br><br></div><div>Same in interactive.c<br><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+       if (family == AF_INET)<br>
+       {<br>
+               if (err != NO_ERROR)<br>
+               {<br>
+                       msg(M_WARN, &quot;TUN: Setting IPv4 mtu failed: %s [status=%u if_index=%d]&quot;,<br>
+                               strerror_win32(err, &amp;gc), err, iface_index);<br>
+               }<br>
+               else<br>
+               {<br>
+                       msg(M_INFO, &quot;Successfully set IPv4 mtu on interface %d&quot;, iface_index);<br>
+               }<br>
+       }<br>
+       else if (family == AF_INET6)<br>
+       {<br>
+               if (err != NO_ERROR)<br>
+               {<br>
+                       msg(M_WARN, &quot;TUN: Setting IPv6 mtu failed: %s [status=%u if_index=%d]&quot;,<br>
+                               strerror_win32(err, &amp;gc), err, iface_index);<br>
+               }<br>
+               else<br>
+               {<br>
+                       msg(M_INFO, &quot;Successfully set IPv6 mtu on interface %d&quot;, iface_index);<br>
+               }<br>
+       }<br>
 }<br>
<br>
+<br>
 /*<br>
  * Return a TAP name for netsh commands.<br>
  */<br>
diff --git a/src/openvpnserv/interactive.c b/src/openvpnserv/interactive.c<br>
index 31e4afa0..6e6a63fe 100644<br>
--- a/src/openvpnserv/interactive.c<br>
+++ b/src/openvpnserv/interactive.c<br>
@@ -33,6 +33,7 @@<br>
 #include &lt;sddl.h&gt;<br>
 #include &lt;shellapi.h&gt;<br>
 #include &lt;mstcpip.h&gt;<br>
+#include &lt;netioapi.h&gt;<br>
<br></blockquote><div><br></div><div>There should be no need to include this header directly. Instead let<br>the main IP Helper API header (iphlpapi.h) include it correctly.<br>The latter is already included both in tun.c and interactive.c<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
 #ifdef HAVE_VERSIONHELPERS_H<br>
 #include &lt;versionhelpers.h&gt;<br>
@@ -1202,42 +1203,13 @@ static DWORD<br>
 HandleMTUMessage(const set_mtu_message_t *mtu)<br>
 {<br>
        DWORD err = 0;<br>
-       DWORD timeout = 5000; /* in milli seconds */<br>
-       wchar_t argv0[MAX_PATH];<br>
-<br>
-       /* Path of netsh */<br>
-       swprintf(argv0, _countof(argv0), L&quot;%s\\%s&quot;, get_win_sys_path(), L&quot;netsh.exe&quot;);<br>
-       argv0[_countof(argv0) - 1] = L&#39;\0&#39;;<br>
-<br>
-       /* cmd template:<br>
-        * netsh interface $family set subinterface &quot;$if_name&quot; mtu=$mtu<br>
-        */<br>
-       const wchar_t *fmt;<br>
-       if (mtu-&gt;family == AF_INET)<br>
-       {<br>
-               fmt = L&quot;netsh interface ipv4 set subinterface \&quot;%d\&quot; mtu= %d&quot;;<br>
-       }<br>
-       else if (mtu-&gt;family == AF_INET6)<br>
-       {<br>
-               fmt = L&quot;netsh interface ipv6 set subinterface \&quot;%d\&quot; mtu= %d&quot;;<br>
-       }<br>
-<br>
-       /* max cmdline length in wchars -- include room for if index:<br>
-        * 20 chars for two 32 bit int in decimal and +1 for NUL<br>
-        */<br>
-       size_t ncmdline = wcslen(fmt) + 20 + 1;<br>
-       wchar_t *cmdline = malloc(ncmdline * sizeof(wchar_t));<br>
-       if (!cmdline)<br>
-       {<br>
-               err = ERROR_OUTOFMEMORY;<br>
-               return err;<br>
-       }<br>
-<br>
-       openvpn_sntprintf(cmdline, ncmdline, fmt, mtu-&gt;iface.index, mtu-&gt;mtu);<br>
-<br>
-       err = ExecCommand(argv0, cmdline, timeout);<br>
-<br>
-       free(cmdline);<br>
+       MIB_IPINTERFACE_ROW row;<br>
+       InitializeIpInterfaceEntry(&amp;row);<br>
+       row.Family = mtu-&gt;family;<br>
+       row.InterfaceIndex = mtu-&gt;iface.index;<br>
+       row.NlMtu = mtu-&gt;mtu;<br>
+<br>
+       err = SetIpInterfaceEntry(&amp;row);<br></blockquote><div><br></div><div>See the remark above.<br> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
        return err;<br>
 }<br>
<br></blockquote><br><div>Selva<br></div></div></div>

Patch

diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c
index b0230a7c..9fe8444f 100644
--- a/src/openvpn/tun.c
+++ b/src/openvpn/tun.c
@@ -69,10 +69,8 @@  static void netsh_ifconfig(const struct tuntap_options *to,
                            const in_addr_t netmask,
                            const unsigned int flags);
 
-static void netsh_set_mtu_ipv4(const char *flex_name,
-                               const int mtu);
-
-static void netsh_set_mtu_ipv6(const char *flex_name,
+static void windows_set_mtu(const int iface_indey,
+								short family,
                                const int mtu);
 
 static void netsh_set_dns6_servers(const struct in6_addr *addr_list,
@@ -1064,7 +1062,7 @@  do_ifconfig_ipv6(struct tuntap *tt, const char *ifname, int tun_mtu,
         netsh_command(&argv, 4, M_FATAL);
         /* set ipv6 dns servers if any are specified */
         netsh_set_dns6_servers(tt->options.dns6, tt->options.dns6_len, ifname);
-        netsh_set_mtu_ipv6(ifname, tun_mtu);
+		windows_set_mtu(tt->adapter_index, AF_INET6, tun_mtu);
     }
 
     /* explicit route needed */
@@ -1464,7 +1462,7 @@  do_ifconfig_ipv4(struct tuntap *tt, const char *ifname, int tun_mtu,
 		}
 		else
 		{
-			netsh_set_mtu_ipv4(ifname, tun_mtu);
+			windows_set_mtu(tt->adapter_index, AF_INET, tun_mtu);
 		}
     }
 
@@ -5309,35 +5307,45 @@  out:
 }
 
 static void
-netsh_set_mtu_ipv4(const char *flex_name,
-                   const int mtu)
-{
-	struct argv argv = argv_new();
-	argv_printf(&argv, "%s%sc interface ipv4 set subinterface %s mtu = %d store=active",
-		get_win_sys_path(),
-		NETSH_PATH_SUFFIX,
-		flex_name,
-		mtu);
-
-	netsh_command(&argv, 3, M_WARN);
-	argv_reset(&argv);
-}
-
-static void
-netsh_set_mtu_ipv6(const char *flex_name,
+windows_set_mtu(const int iface_index, const short family,
 	const int mtu)
 {
-	struct argv argv = argv_new();
-	argv_printf(&argv, "%s%sc interface ipv6 set subinterface %s mtu = %d store=active",
-		get_win_sys_path(),
-		NETSH_PATH_SUFFIX,
-		flex_name,
-		mtu);
+	DWORD err = 0;
+	struct gc_arena gc = gc_new();
+	MIB_IPINTERFACE_ROW row;
+	InitializeIpInterfaceEntry(&row);
+	row.Family = family;
+	row.InterfaceIndex = iface_index;
+	row.NlMtu = mtu;
 
-	netsh_command(&argv, 3, M_WARN);
-	argv_reset(&argv);
+	err = SetIpInterfaceEntry(&row);
+	if (family == AF_INET)
+	{
+		if (err != NO_ERROR)
+		{
+			msg(M_WARN, "TUN: Setting IPv4 mtu failed: %s [status=%u if_index=%d]",
+				strerror_win32(err, &gc), err, iface_index);
+		}
+		else
+		{
+			msg(M_INFO, "Successfully set IPv4 mtu on interface %d", iface_index);
+		}
+	}
+	else if (family == AF_INET6)
+	{
+		if (err != NO_ERROR)
+		{
+			msg(M_WARN, "TUN: Setting IPv6 mtu failed: %s [status=%u if_index=%d]",
+				strerror_win32(err, &gc), err, iface_index);
+		}
+		else
+		{
+			msg(M_INFO, "Successfully set IPv6 mtu on interface %d", iface_index);
+		}
+	}
 }
 
+
 /*
  * Return a TAP name for netsh commands.
  */
diff --git a/src/openvpnserv/interactive.c b/src/openvpnserv/interactive.c
index 31e4afa0..6e6a63fe 100644
--- a/src/openvpnserv/interactive.c
+++ b/src/openvpnserv/interactive.c
@@ -33,6 +33,7 @@ 
 #include <sddl.h>
 #include <shellapi.h>
 #include <mstcpip.h>
+#include <netioapi.h>
 
 #ifdef HAVE_VERSIONHELPERS_H
 #include <versionhelpers.h>
@@ -1202,42 +1203,13 @@  static DWORD
 HandleMTUMessage(const set_mtu_message_t *mtu)
 {
 	DWORD err = 0;
-	DWORD timeout = 5000; /* in milli seconds */
-	wchar_t argv0[MAX_PATH];
-
-	/* Path of netsh */
-	swprintf(argv0, _countof(argv0), L"%s\\%s", get_win_sys_path(), L"netsh.exe");
-	argv0[_countof(argv0) - 1] = L'\0';
-
-	/* cmd template:
-	 * netsh interface $family set subinterface "$if_name" mtu=$mtu
-	 */
-	const wchar_t *fmt;
-	if (mtu->family == AF_INET)
-	{
-		fmt = L"netsh interface ipv4 set subinterface \"%d\" mtu= %d";
-	}
-	else if (mtu->family == AF_INET6)
-	{
-		fmt = L"netsh interface ipv6 set subinterface \"%d\" mtu= %d";
-	}
-
-	/* max cmdline length in wchars -- include room for if index:
-	 * 20 chars for two 32 bit int in decimal and +1 for NUL
-	 */
-	size_t ncmdline = wcslen(fmt) + 20 + 1;
-	wchar_t *cmdline = malloc(ncmdline * sizeof(wchar_t));
-	if (!cmdline)
-	{
-		err = ERROR_OUTOFMEMORY;
-		return err;
-	}
-
-	openvpn_sntprintf(cmdline, ncmdline, fmt, mtu->iface.index, mtu->mtu);
-
-	err = ExecCommand(argv0, cmdline, timeout);
-
-	free(cmdline);
+	MIB_IPINTERFACE_ROW row;
+	InitializeIpInterfaceEntry(&row);
+	row.Family = mtu->family;
+	row.InterfaceIndex = mtu->iface.index;
+	row.NlMtu = mtu->mtu;
+
+	err = SetIpInterfaceEntry(&row);
 	return err;
 }