From 523a02aa7a99ad8570aa4ccb1b1c49223eae3e25 Mon Sep 17 00:00:00 2001 From: David Greenman Date: Wed, 28 Jun 1995 05:31:03 +0000 Subject: [PATCH] Don't skip point-to-point interfaces if the netmask==0 (the netmask should be completely ignored for point-to-point interfaces). For point-to-point interfaces, route based on the destination address, not the local address. Submitted by: Peter Wemm --- sys/net/if.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/net/if.c b/sys/net/if.c index a9085d507909..65ef003da23c 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)if.c 8.3 (Berkeley) 1/4/94 - * $Id: if.c,v 1.15 1995/05/30 08:07:58 rgrimes Exp $ + * $Id: if.c,v 1.16 1995/06/15 00:19:56 davidg Exp $ */ #include @@ -237,12 +237,14 @@ ifa_ifwithnet(addr) for (ifa = ifp->if_addrlist; ifa; ifa = ifa->ifa_next) { register char *cp, *cp2, *cp3; - if (ifa->ifa_addr->sa_family != af || ifa->ifa_netmask == 0) + if (ifa->ifa_addr->sa_family != af) next: continue; if (ifp->if_flags & IFF_POINTOPOINT) { - if (equal(addr, ifa->ifa_addr)) + if (equal(addr, ifa->ifa_dstaddr)) return (ifa); } else { + if (ifa->ifa_netmask == 0) + continue; cp = addr_data; cp2 = ifa->ifa_addr->sa_data; cp3 = ifa->ifa_netmask->sa_data;