Source-Changes-HG archive

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

[src/netbsd-6]: src/sys/net Pull up following revision(s) (requested by chris...



details:   https://anonhg.NetBSD.org/src/rev/9d8c4453f8a8
branches:  netbsd-6
changeset: 776389:9d8c4453f8a8
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Mon Jul 29 05:43:13 2013 +0000

description:
Pull up following revision(s) (requested by christos in ticket #909):
        sys/net/route.c: revision 1.127
PR/44032: Proxy entries stopped working with pppd. The issue here is that
the route entry was added, but the RTF_LLINFO bit was not set, making arp -a
not showing the entry, but netstat -rn -f inet showing it with the missing
L bit. The order of resolution in ifa_ifwithroute() is that if a destination
address is found, then the interface chosen for the route is that of the
destination. This does not work for link-level addresses since the ppp
interface does not arp (uses link_rtrequest, not arp_rtrequest), so the
bit is never set. The easy solution here is to check that the gateway is
a link address, and use the interface which we chose for the link address
as opposed to the interface that routes to the destination. This restores
the previous behavior, but is it correct?

diffstat:

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

diffs (36 lines):

diff -r ca488aee459e -r 9d8c4453f8a8 sys/net/route.c
--- a/sys/net/route.c   Mon Jul 29 05:35:41 2013 +0000
+++ b/sys/net/route.c   Mon Jul 29 05:43:13 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: route.c,v 1.126 2012/01/30 20:01:08 christos Exp $     */
+/*     $NetBSD: route.c,v 1.126.2.1 2013/07/29 05:43:13 msaitoh Exp $  */
 
 /*-
  * Copyright (c) 1998, 2008 The NetBSD Foundation, Inc.
@@ -93,7 +93,7 @@
 #include "opt_route.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: route.c,v 1.126 2012/01/30 20:01:08 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: route.c,v 1.126.2.1 2013/07/29 05:43:13 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/kmem.h>
@@ -594,7 +594,7 @@
                 * we can use the local address.
                 */
                ifa = NULL;
-               if (flags & RTF_HOST)
+               if ((flags & RTF_HOST) && gateway->sa_family != AF_LINK)
                        ifa = ifa_ifwithdstaddr(dst);
                if (ifa == NULL)
                        ifa = ifa_ifwithaddr(gateway);
@@ -619,7 +619,7 @@
        if (ifa->ifa_addr->sa_family != dst->sa_family) {
                struct ifaddr *oifa = ifa;
                ifa = ifaof_ifpforaddr(dst, ifa->ifa_ifp);
-               if (ifa == 0)
+               if (ifa == NULL)
                        ifa = oifa;
        }
        return ifa;



Home | Main Index | Thread Index | Old Index