From eeec1b40a7d95b4be679413d1c54743f239334bd Mon Sep 17 00:00:00 2001 From: Pavel Emelyanov Date: Fri, 27 Dec 2013 16:00:57 +0400 Subject: [PATCH] net: Add comment about not using ifindex for setlink Signed-off-by: Pavel Emelyanov --- net.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/net.c b/net.c index 75c400dda..64c94de43 100644 --- a/net.c +++ b/net.c @@ -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;