summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-rtnl/rtnl-message.c
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-02-16 21:39:50 +0100
committerTom Gundersen <teg@jklm.no>2014-02-16 23:17:19 +0100
commit489e4fbb8c04bf26bb363bfdf4bbcd1505398528 (patch)
tree9132d9a6683b939afdd3e7287cdb15c56e0fc5c4 /src/libsystemd/sd-rtnl/rtnl-message.c
parent6cd6fdb22820c5881a316831f4cf57d5d6e31144 (diff)
sd-rtnl: do not require ifindex to be set for SETLINK messages
The kernel will then look up the ifindex itself based on the name. This should be used very carefully as it is racey. [This was a left-over hunk from my previous nspawn patch.]
Diffstat (limited to 'src/libsystemd/sd-rtnl/rtnl-message.c')
-rw-r--r--src/libsystemd/sd-rtnl/rtnl-message.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libsystemd/sd-rtnl/rtnl-message.c b/src/libsystemd/sd-rtnl/rtnl-message.c
index 15e3247aca..a13bd48725 100644
--- a/src/libsystemd/sd-rtnl/rtnl-message.c
+++ b/src/libsystemd/sd-rtnl/rtnl-message.c
@@ -147,7 +147,8 @@ int sd_rtnl_message_new_link(uint16_t nlmsg_type, int index, sd_rtnl_message **r
int r;
assert_return(rtnl_message_type_is_link(nlmsg_type), -EINVAL);
- assert_return(nlmsg_type == RTM_NEWLINK || index > 0, -EINVAL);
+ assert_return(nlmsg_type == RTM_NEWLINK ||
+ nlmsg_type == RTM_SETLINK || index > 0, -EINVAL);
assert_return(ret, -EINVAL);
r = message_new(ret, NLMSG_SPACE(sizeof(struct ifinfomsg)));