NetworkManager/src/libnm-platform
Thomas Haller 621b41ebfa
platform: detect EINVAL as failure to set the MTU
Some drivers will reject an invalid MTU size with EINVAL.

Quote from [1]:

  While investigating, I did notice that do_change_link in
  nm-linux-platform.c really ought to count -EINVAL as an MTU out-of-range
  error and not just -ERANGE. Even if the hardware supports a large MTU,
  if the transmit FIFO is set too small, stmmac_change_mtu [2] will return
  -EINVAL. For example, on my device, the maxmtu is 9000 but in practice I
  can't set an MTU larger than 4096 unless I first run ethtool
  --set-channels eno1 tx 3.

[1] https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1198#note_1738311
[2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c?h=v6.1#n5577
2023-01-25 09:05:58 +01:00
..
tests platform: support VTI6 tunnels 2022-12-21 14:04:44 +01:00
wifi all: use _NM_G_TYPE_CHECK_INSTANCE_CAST() for internal uses 2022-12-16 10:55:03 +01:00
wpan all: use _NM_G_TYPE_CHECK_INSTANCE_CAST() for internal uses 2022-12-16 10:55:03 +01:00
meson.build platform: add "nmp-base.c" source 2022-09-23 11:43:35 +02:00
nm-linux-platform.c platform: detect EINVAL as failure to set the MTU 2023-01-25 09:05:58 +01:00
nm-linux-platform.h platform: allow setting multi_idx instance for NMPlatform 2023-01-19 08:56:21 +01:00
nm-netlink.c all: fix various "-Wcast-align=strict" warnings 2022-12-09 09:15:56 +01:00
nm-netlink.h all: fix various "-Wcast-align=strict" warnings 2022-12-09 09:15:56 +01:00
nm-platform-private.h format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-platform-utils.c platform: make "now" timestamp an in/out parameter to nmp_utils_lifetime_get() 2022-04-08 15:59:48 +02:00
nm-platform-utils.h platform: make "now" timestamp an in/out parameter to nmp_utils_lifetime_get() 2022-04-08 15:59:48 +02:00
nm-platform.c platform: allow setting multi_idx instance for NMPlatform 2023-01-19 08:56:21 +01:00
nm-platform.h platform: allow setting multi_idx instance for NMPlatform 2023-01-19 08:56:21 +01:00
nmp-base.c platform: move NMPlatformIP[46]Address to "nmp-plobj.c" 2022-09-23 11:43:36 +02:00
nmp-base.h platform: support VTI6 tunnels 2022-12-21 14:04:44 +01:00
nmp-global-tracker.c platform: fix tracking similar objects in NMPGlobalTracker 2022-09-15 18:18:26 +02:00
nmp-global-tracker.h mptcp: fix nmp_global_tracker_sync_mptcp_addrs() 2022-08-10 11:35:28 +02:00
nmp-netns.c platform: avoid printing raw pointer values in log 2023-01-19 08:56:21 +01:00
nmp-netns.h all: use _NM_G_TYPE_CHECK_INSTANCE_CAST() for internal uses 2022-12-16 10:55:03 +01:00
nmp-object.c platform: resync route cache upon NLM_F_REPLACE flag 2023-01-19 08:56:21 +01:00
nmp-object.h platform: add NMP_OBJECT_TYPE_NAME() macro 2023-01-19 08:56:21 +01:00
nmp-plobj.c platform: move NMPlatformIP[46]Address to "nmp-plobj.c" 2022-09-23 11:43:36 +02:00
nmp-plobj.h platform: ensure all NMPlatform* structs have same alignment 2022-12-09 09:15:54 +01:00
README.md platform: support IPv6 mulitpath routes and fix cache inconsistency 2022-02-16 09:59:49 +01:00

libnm-platform

A static helper library that provides NMPlatform and other utils. This is NetworkManager's internal netlink library, but also contains helpers for sysfs, ethtool and other kernel APIs.

NMPlaform is also a cache of objects of the netlink API: NMPCache and NMPObject. These objects are used throughout NetworkManager also for generally tracking information about these types. For example, NMPlatformIP4Address (the public part of a certain type of NMPObject) is not only used to track platform addresses from netlink in the cache, but to track information about IPv4 addresses in general.

This depends on the following helper libraries