When an interface leaved from the master interface, then reading
IFLA_MASTER attribute causes ENODATA. When the interface was previously
enslaved to another interface, we need to remove reference to the
interface from the previous master interface.
This is especially important when
```
ip link set dev eth0 nomaster
```
is called.
Fixes a bug introduced by
0d411b7f8f5407e9ce84dcb4ede0b029ade7fede (v249).
Fixes #37629.
r = sd_netlink_message_read_u32(message, IFLA_MASTER, (uint32_t*) &master_ifindex);
if (r == -ENODATA)
- return 0;
- if (r < 0)
+ master_ifindex = 0; /* no master interface */
+ else if (r < 0)
return log_link_debug_errno(link, r, "rtnl: failed to read master ifindex: %m");
if (master_ifindex == link->ifindex)