aboutsummaryrefslogtreecommitdiff
path: root/src/mm-netlink.c
diff options
context:
space:
mode:
authorBjørn Mork <bjorn@mork.no>2022-03-28 11:57:42 +0200
committerBjørn Mork <bjorn@mork.no>2022-03-28 13:25:07 +0200
commit7bbf6c8a4aebfe33f9bebfe997288c45624d269a (patch)
tree56816336d09c44933e14c4e4208262eeb5b5886f /src/mm-netlink.c
parentb5a0a500404cd3b14438222f2b42caece7fb8970 (diff)
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>
Diffstat (limited to 'src/mm-netlink.c')
-rw-r--r--src/mm-netlink.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/mm-netlink.c b/src/mm-netlink.c
index 5fd2ab34..40b108d1 100644
--- a/src/mm-netlink.c
+++ b/src/mm-netlink.c
@@ -136,8 +136,6 @@ netlink_message_new (guint ifindex,
hdr->msghdr.nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK;
hdr->ifreq.ifi_family = AF_UNSPEC;
hdr->ifreq.ifi_index = ifindex;
- hdr->ifreq.ifi_flags = 0;
- hdr->ifreq.ifi_change = 0xFFFFFFFF;
return msg;
}
@@ -154,7 +152,7 @@ netlink_message_new_setlink (guint ifindex,
hdr = netlink_message_header (msg);
hdr->ifreq.ifi_flags = up ? IFF_UP : 0;
- hdr->ifreq.ifi_change = 0xFFFFFFFF;
+ hdr->ifreq.ifi_change = IFF_UP;
if (mtu)
append_netlink_attribute_uint32 (msg, IFLA_MTU, mtu);