From b8d2a7b0229e9328b0b52cbd38d1517c31da02c2 Mon Sep 17 00:00:00 2001 From: dg Date: Wed, 28 Jun 1995 05:31:03 +0000 Subject: 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(-) (limited to 'sys/net') diff --git a/sys/net/if.c b/sys/net/if.c index a9085d5..65ef003 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; -- cgit v1.1