2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-30 13:58:34 +00:00

net: Add comment about not using ifindex for setlink

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Pavel Emelyanov
2013-12-27 16:00:57 +04:00
parent 7ab8a3261b
commit eeec1b40a7

5
net.c
View File

@@ -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_seq = CR_NLMSG_SEQ;
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)
req.i.ifi_index = nde->ifindex;
req.i.ifi_flags = nde->flags;