Skip to content

[th/bond-port-mtu] device: reset MTU after attaching bond port

Thomas Haller requested to merge th/bond-port-mtu into main

When attaching a bond port, kernel will reset the MTU of the port ([1], [2]). Configuring a different MTU on the port seems not a sensible thing to do.

Still, before commit e67ddd82 ('device: commit MTU during stage2') we would first attach the bond port before setting the MTU. That changed, and now the MTU set by kernel wins.

Btw, this change in behavior also happens because we attach the port in stage3 (ip-config), which seems an ugly thing to do.

It is probably not sensible to configure a different MTU. Still, if the user requested it by configuration, we should apply it. Note that NetworkManager has some logic to constrain the MTU based on the parent/child and controller/port. Still, in may respect, NetworkManager does not fully understand or enforce the correct MTU and relies on the user to configure it correctly. After all, if you misconfigure the MTU, your setup will have problems anyway (even if kernel or NetworkManager could not see anything wrong with it). If the user configures an MTU, enforce it after attaching the port to the bond.

Merge request reports