From 2d55efad60a9c0057844129d6e922663676cc47b Mon Sep 17 00:00:00 2001 From: Mike Karels Date: Fri, 21 Dec 1984 02:01:19 -0800 Subject: [PATCH] add if_ifwithdstaddr SCCS-vsn: sbin/routed/if.c 4.4 --- usr/src/sbin/routed/if.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/usr/src/sbin/routed/if.c b/usr/src/sbin/routed/if.c index b8ca7b6e0e..07aa4345d4 100644 --- a/usr/src/sbin/routed/if.c +++ b/usr/src/sbin/routed/if.c @@ -1,5 +1,5 @@ #ifndef lint -static char sccsid[] = "@(#)if.c 4.3 (Berkeley) %G%"; +static char sccsid[] = "@(#)if.c 4.4 (Berkeley) %G%"; #endif /* @@ -10,7 +10,7 @@ static char sccsid[] = "@(#)if.c 4.3 (Berkeley) %G%"; extern struct interface *ifnet; /* - * Find the interface with address add. + * Find the interface with address addr. */ struct interface * if_ifwithaddr(addr) @@ -34,6 +34,24 @@ if_ifwithaddr(addr) return (ifp); } +/* + * Find the point-to-point interface with destination address addr. + */ +struct interface * +if_ifwithdstaddr(addr) + struct sockaddr *addr; +{ + register struct interface *ifp; + + for (ifp = ifnet; ifp; ifp = ifp->int_next) { + if ((ifp->int_flags & IFF_POINTOPOINT) == 0) + continue; + if (same(&ifp->int_dstaddr, addr)) + break; + } + return (ifp); +} + /* * Find the interface on the network * of the specified address. -- 2.20.1