summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-rtnl
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-02-14 12:15:26 +0100
committerTom Gundersen <teg@jklm.no>2014-02-15 12:14:45 +0100
commita7b74db6e72f4f19f74eabc81c1ebb4cb8670f06 (patch)
tree55406bf721fe7913906cf0384f6a64b653149cf3 /src/libsystemd/sd-rtnl
parent93b5eaec70cc323046cad69a5e17993672a6f2f7 (diff)
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.
Diffstat (limited to 'src/libsystemd/sd-rtnl')
-rw-r--r--src/libsystemd/sd-rtnl/rtnl-message.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/libsystemd/sd-rtnl/rtnl-message.c b/src/libsystemd/sd-rtnl/rtnl-message.c
index c780f71881..226329f314 100644
--- a/src/libsystemd/sd-rtnl/rtnl-message.c
+++ b/src/libsystemd/sd-rtnl/rtnl-message.c
@@ -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;
}