[systemd-commits] src/libsystemd
Tom Gundersen
tomegun at kemper.freedesktop.org
Sun Feb 16 23:17:24 CET 2014
src/libsystemd/sd-rtnl/rtnl-message.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
New commits:
commit 489e4fbb8c04bf26bb363bfdf4bbcd1505398528
Author: Tom Gundersen <teg at jklm.no>
Date: Sun Feb 16 21:39:50 2014 +0100
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.]
diff --git a/src/libsystemd/sd-rtnl/rtnl-message.c b/src/libsystemd/sd-rtnl/rtnl-message.c
index 15e3247..a13bd48 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)));
More information about the systemd-commits
mailing list