Commit eeec1b40 authored by Pavel Emelyanov's avatar Pavel Emelyanov

net: Add comment about not using ifindex for setlink

Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 7ab8a326
...@@ -256,6 +256,11 @@ static int do_rtm_link_req(int msg_type, NetDeviceEntry *nde, int nlsk, ...@@ -256,6 +256,11 @@ static int do_rtm_link_req(int msg_type, NetDeviceEntry *nde, int nlsk,
req.h.nlmsg_type = msg_type; req.h.nlmsg_type = msg_type;
req.h.nlmsg_seq = CR_NLMSG_SEQ; req.h.nlmsg_seq = CR_NLMSG_SEQ;
req.i.ifi_family = AF_PACKET; req.i.ifi_family = AF_PACKET;
/*
* SETLINK is called for external devices which may
* have ifindex changed. Thus configure them by their
* name only.
*/
if (msg_type == RTM_NEWLINK) if (msg_type == RTM_NEWLINK)
req.i.ifi_index = nde->ifindex; req.i.ifi_index = nde->ifindex;
req.i.ifi_flags = nde->flags; req.i.ifi_flags = nde->flags;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment