mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-07 11:58:12 +02:00
device: expand comment on MTU selection
(cherry picked from commit 6455a4e528)
This commit is contained in:
parent
f35783c3fb
commit
37720d856a
1 changed files with 15 additions and 3 deletions
|
|
@ -9333,9 +9333,21 @@ _commit_mtu (NMDevice *self, const NMIP4Config *config)
|
||||||
{
|
{
|
||||||
guint32 mtu = 0;
|
guint32 mtu = 0;
|
||||||
|
|
||||||
/* preferably, get the MTU from explicit user-configuration.
|
/* We take the MTU from various sources: (in order of increasing
|
||||||
* Only if that fails, look at the current @config (which contains
|
* priority) parent link, IP configuration (which contains the
|
||||||
* MTUs from DHCP/PPP) or maybe fallback to a device-specific MTU. */
|
* MTU from DHCP/PPP), connection profile.
|
||||||
|
*
|
||||||
|
* We could just compare it with the platform MTU and apply it
|
||||||
|
* when different, but this would revert at random times manual
|
||||||
|
* changes done by the user with the MTU from the connection.
|
||||||
|
*
|
||||||
|
* Instead, we remember the source of the currently configured
|
||||||
|
* MTU and apply the new one only when the new source has a
|
||||||
|
* higher priority, so that we don't set a MTU from same source
|
||||||
|
* multiple times. An exception to this is for the PARENT
|
||||||
|
* source, since we need to keep tracking the parent MTU when it
|
||||||
|
* changes.
|
||||||
|
*/
|
||||||
|
|
||||||
if (NM_DEVICE_GET_CLASS (self)->get_configured_mtu)
|
if (NM_DEVICE_GET_CLASS (self)->get_configured_mtu)
|
||||||
mtu = NM_DEVICE_GET_CLASS (self)->get_configured_mtu (self, &source);
|
mtu = NM_DEVICE_GET_CLASS (self)->get_configured_mtu (self, &source);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue