Module Name: src Committed By: ozaki-r Date: Mon Jul 4 01:36:06 UTC 2016
Modified Files: src/sys/net: if.c Log Message: Tweak p2p_rtrequest as well for ifaddr initialization change We need to set lo0ifp to rt->rt_ifp if the interface is RTF_LOCAL. Fix PR kern/51301. To generate a diff of this commit: cvs rdiff -u -r1.350 -r1.351 src/sys/net/if.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/net/if.c diff -u src/sys/net/if.c:1.350 src/sys/net/if.c:1.351 --- src/sys/net/if.c:1.350 Fri Jul 1 05:22:33 2016 +++ src/sys/net/if.c Mon Jul 4 01:36:06 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: if.c,v 1.350 2016/07/01 05:22:33 ozaki-r Exp $ */ +/* $NetBSD: if.c,v 1.351 2016/07/04 01:36:06 ozaki-r Exp $ */ /*- * Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc. @@ -90,7 +90,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.350 2016/07/01 05:22:33 ozaki-r Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.351 2016/07/04 01:36:06 ozaki-r Exp $"); #if defined(_KERNEL_OPT) #include "opt_inet.h" @@ -2021,6 +2021,8 @@ p2p_rtrequest(int req, struct rtentry *r if ((rt->rt_flags & RTF_LOCAL) == 0) break; + rt->rt_ifp = lo0ifp; + IFADDR_FOREACH(ifa, ifp) { if (equal(rt_getkey(rt), ifa->ifa_addr)) break; @@ -2039,8 +2041,6 @@ p2p_rtrequest(int req, struct rtentry *r if (lo0ifa == NULL) break; - rt->rt_ifp = lo0ifp; - /* * Make sure to set rt->rt_ifa to the interface * address we are using, otherwise we will have trouble