rtsock: Fill in the rtm_index field whenever we have an interface pointer.
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Sun, 1 Feb 2009 03:13:45 +0000 (11:13 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Tue, 17 Feb 2009 10:35:54 +0000 (18:35 +0800)
Obtained-from: FreeBSD (net/rtsock.c rev1.123)

sys/net/rtsock.c

index 53eb31a..0c9f1b9 100644 (file)
@@ -431,6 +431,8 @@ fillrtmsg(struct rt_msghdr **prtm, struct rtentry *rt,
                        rtinfo->rti_ifpaddr = NULL;
                        rtinfo->rti_ifaaddr = NULL;
                }
+       } else if (rt->rt_ifp != NULL) {
+               rtm->rtm_index = rt->rt_ifp->if_index;
        }
 
        msglen = rt_msgsize(rtm->rtm_type, rtinfo);