<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-NZ" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">When changing an interface MTU direct through ip command, netifd will get be out of sync. The netifd internally tracked MTU (discoverable through ubus call network.device status '{"name":"xxx"}'
call will always show 1500 (or whatever the value was when netifd discovered/created the interface).<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">I am not aware of any actual issues caused by this, but it is worth considering.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Finding some method to update through ubus is preferable in my opinion.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">For the project I have been working on, we added a ubus network.device set_attr method to netifd to solve this problem – see attached patch. Then you can use this in the protocol handler:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"> [ -n "$mtu" ] && {<br>
echo "Setting MTU to $mtu"<br>
/sbin/ubus call network.device set_attr "{\"device\":\"$ifname\", \"mtu\":\"$mtu\"}"<br>
}<br>
<br>
<span style="mso-fareast-language:EN-US"><o:p></o:p></span></p>
<hr>
<table style="FONT-SIZE: 11px; FONT-FAMILY: Arial; LINE-HEIGHT: 17px" cellspacing="0" cellpadding="0" width="600" border="0">
<tbody>
<tr>
<td style="WIDTH: 325px; PADDING-LEFT: 10px; PADDING-RIGHT: 10px">
<p style="FONT-SIZE: 13px; FONT-FAMILY: Arial; FONT-WEIGHT: bold; PADDING-BOTTOM: 5px; MARGIN: 0px 0px 5px">
<font color="#ea161e"><img border="0" vspace="5" src="cid:4RFLogo(Custom)(2)_0f31a7de-6dd6-43cf-bc6a-a097a2b80b69.jpg"><br>
</font><font color="#000000">Reuben Dowle<br>
<span style="FONT-WEIGHT: normal">Software Architect </span></font></p>
</td>
<td style="FONT-SIZE: 10px; PADDING-TOP: 5px; PADDING-LEFT: 5px; BORDER-LEFT: #ea161e 5px solid" valign="top" align="left">
<p style="FONT-SIZE: 10px; FONT-FAMILY: Arial" align="left">Phone:<br>
<br>
Fax:<br>
E-Mail:<br>
Website:</p>
</td>
<td style="PADDING-TOP: 5px" valign="top">
<p style="FONT-SIZE: 10px; FONT-FAMILY: Arial; PADDING-TOP: 5px; PADDING-LEFT: 5px; MARGIN: 0px 0px 5px">
+64 4 499 6000<br>
<br>
+64 4 473 4447<br>
<a href="mailto:reuben.dowle@4rf.com">reuben.dowle@4rf.com</a><br>
<a href="https://www.4rf.com">Https://www.4rf.com</a></p>
</td>
</tr>
</tbody>
</table>
<strong><em>
<hr>
<br>
<a href="http://www.4rf.com/news/events"><img style="HEIGHT: 76px; WIDTH: 468px" border="0" src="cid:Family_53c410b1-7227-4a5f-9acb-f09bd7617a39.png" width="468" height="76">
</a>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"></p>
</em></strong>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span lang="EN-US"> openwrt-devel <openwrt-devel-bounces@lists.openwrt.org>
<b>On Behalf Of </b>Michael Jones<br>
<b>Sent:</b> Tuesday, 26 May 2020 5:21 am<br>
<b>To:</b> Aleksander Morgado <aleksander@aleksander.es><br>
<b>Cc:</b> openwrt-devel <openwrt-devel@lists.openwrt.org><br>
<b>Subject:</b> Re: [OpenWrt-Devel] netifd: per-interface MTU settings vs per-route MTU settings?<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">On Mon, May 25, 2020 at 8:00 AM Aleksander Morgado <<a href="mailto:aleksander@aleksander.es">aleksander@aleksander.es</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
<p class="MsoNormal" style="margin-bottom:12.0pt">Other protocol handlers, like uqmi, are also able to setup the MTU,<br>
and instead of doing it via proto_send_update, they just do it like<br>
this:<br>
<br>
[ -n "$mtu" ] && {<br>
echo "Setting MTU to $mtu"<br>
/sbin/ip link set dev $ifname mtu $mtu<br>
}<br>
<br>
I guess we can do the same in the ModemManager protocol handler.<o:p></o:p></p>
</blockquote>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">That does seem like it would work, but I'm wary of race conditions with the message sent to netifd via ubus, and further feel like it would be better to have netifd learn how to set the mtu directly, if it doesn't already know how.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Are any of the netifd project's contributors able to comment on this?<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
</div>
<font color="#9a9a9a"><font style="FONT-SIZE: 8pt" face="Arial">
<hr style="FONT-SIZE: 8pt; FONT-FAMILY: Arial">
The information in this email communication (inclusive of attachments) is confidential to 4RF Limited and the intended recipient(s). If you are not the intended recipient(s), please note that any use, disclosure, distribution or copying of this information
or any part thereof is strictly prohibited and that the author accepts no liability for the consequences of any action taken on the basis of the information provided. If you have received this email in error, please notify the sender immediately by return
email and then delete all instances of this email from your system. 4RF Limited will not accept responsibility for any consequences associated with the use of this email (including, but not limited to, damages sustained as a result of any viruses and/or any
action or lack of action taken in reliance on it).</font> </font>
</body>
</html>