mirror of
https://github.com/systemd/systemd.git
synced 2025-03-19 22:50:17 +03:00
sd-rtnl: link flags - don't allow change = 0
The kernel will happily treat 0x0 as 0xffffffff, but it is for backwards compatibility only, so let's not perpetuate this.
This commit is contained in:
parent
93b5eaec70
commit
a7b74db6e7
@ -119,14 +119,12 @@ int sd_rtnl_message_link_set_flags(sd_rtnl_message *m, unsigned flags, unsigned
|
||||
assert_return(m, -EINVAL);
|
||||
assert_return(m->hdr, -EINVAL);
|
||||
assert_return(rtnl_message_type_is_link(m->hdr->nlmsg_type), -EINVAL);
|
||||
assert_return(change, -EINVAL);
|
||||
|
||||
ifi = NLMSG_DATA(m->hdr);
|
||||
|
||||
ifi->ifi_flags = flags;
|
||||
if (change)
|
||||
ifi->ifi_change = change;
|
||||
else
|
||||
ifi->ifi_change = 0xffffffff;
|
||||
ifi->ifi_change = change;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user