mirror of
https://github.com/systemd/systemd.git
synced 2025-03-19 22:50:17 +03:00
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:
parent
6cd6fdb228
commit
489e4fbb8c
@ -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)));
|
||||
|
Loading…
x
Reference in New Issue
Block a user