Commit Graph
5 Commits
Author SHA1 Message Date
Dan Williams 9317cbc470 netlink: fix use-after-free calling completion_fn on transaction completion
'tr' is freed when removed from the hash table so we must cache any of its
member values that we need after removal.

Re-implementation of https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/merge_requests/1442

Signed-off-by: Dan Williams <dan@ioncontrol.co>
2026-10-04 23:07:53 -05:00
Dan Williams 0a94b0138d netlink: add RTM_GETLINK support to read MAC address
Since we're also now reading responses we need to check sender
credentials to make sure we're talking to the kernel, and not
some other process spoofing netlink.

Signed-off-by: Dan Williams <dan@ioncontrol.co>
2025-02-18 21:06:19 +00:00
Bjørn Mork afd3ce86c9 mm-netlink: use unaligned netlink attribute length
Alignment padding is not accounted for in the netlink attribute
length.  Fix to avoid warnings later if we add shorter fixed
length attributes, even though it currently makes no difference
since we only add a 4 byte attribute

Signed-off-by: Bjørn Mork <bjorn@mork.no>
2022-03-28 13:25:52 +02:00
Bjørn Mork 7bbf6c8a4a mm-netlink: only change IFF_UP flag
This fixes the missing NOARP flag on the second and following VLAN
sub-interfaces when multiplexing over the cdc_mbim driver.

ifi_change specifies all the flags we want to change. Any listed
flag which isn't set in ifi_flags will be cleared by the kernel:

        if (ifm->ifi_change)
                flags = (flags & ifm->ifi_change) |
                        (rtnl_dev_get_flags(dev) & ~ifm->ifi_change);

Drivers like cdc_mbim set some netdev flags by default, indicating
supported or unsupported features. The driver emulates an ethernet
netdev but it doesn't implement ARP.  Clearing NOARP on cdc_mbim
netdevs will block IP transmissions, waiting for an ARP reply we
never will receive.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
2022-03-28 13:25:07 +02:00
Aleksander Morgado 032a86915a port-net: new 'MMPortNet' object with netlink capabilities
Right now just with the support to setup link properties like up/down
state or the link mtu.

This features are required when using QMAP based multiplexing with the
qmi_wwan kernel driver.
2021-03-10 10:59:22 +01:00