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.]
This commit is contained in:
Tom Gundersen 2014-02-16 21:39:50 +01:00
parent 6cd6fdb228
commit 489e4fbb8c

View file

@ -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)));