On Mon, Jun 1, 2020 at 9:39 PM Reuben Dowle <[email protected]> wrote:

> 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).
>
>
>
> I am not aware of any actual issues caused by this, but it is worth
> considering.
>
>
>
> Finding some method to update through ubus is preferable in my opinion.
>
>
>
> 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:
>
>
>
>         [ -n "$mtu" ] && {
>                 echo "Setting MTU to $mtu"
>                 /sbin/ubus call network.device set_attr
> "{\"device\":\"$ifname\", \"mtu\":\"$mtu\"}"
>         }
>

For what it's worth, I would very much like to see a patch like this merged
into netifd. Modifying the MTU after the fact makes me uncomfortable.
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to