Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/net Tweak p2p_rtrequest as well for ifaddr initializatio...



details:   https://anonhg.NetBSD.org/src/rev/ba4a3625f39e
branches:  trunk
changeset: 346253:ba4a3625f39e
user:      ozaki-r <ozaki-r%NetBSD.org@localhost>
date:      Mon Jul 04 01:36:06 2016 +0000

description:
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.

diffstat:

 sys/net/if.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r 7fea2b341aed -r ba4a3625f39e sys/net/if.c
--- a/sys/net/if.c      Sun Jul 03 19:54:10 2016 +0000
+++ b/sys/net/if.c      Mon Jul 04 01:36:06 2016 +0000
@@ -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 @@
                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 @@
                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



Home | Main Index | Thread Index | Old Index