From 025c380fcce43486afab2ffc7930f1e5f9e46c62 Mon Sep 17 00:00:00 2001 From: Paul Mackerras Date: Mon, 8 Mar 1999 01:47:54 +0000 Subject: [PATCH 1/1] move have_route_to check from ip_addr_check to auth_ip_addr --- pppd/auth.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/pppd/auth.c b/pppd/auth.c index 2f763c1..4b68650 100644 --- a/pppd/auth.c +++ b/pppd/auth.c @@ -33,7 +33,7 @@ */ #ifndef lint -static char rcsid[] = "$Id: auth.c,v 1.43 1999/03/06 11:28:10 paulus Exp $"; +static char rcsid[] = "$Id: auth.c,v 1.44 1999/03/08 01:47:54 paulus Exp $"; #endif #include @@ -1289,6 +1289,12 @@ auth_ip_addr(unit, addr) int unit; u_int32_t addr; { + + if (addresses[unit] == NULL) { + if (auth_required) + return 0; /* no addresses authorized */ + return allow_any_ip || !have_route_to(addr); + } return ip_addr_check(addr, addresses[unit]); } @@ -1307,11 +1313,8 @@ ip_addr_check(addr, addrs) if (bad_ip_adrs(addr)) return 0; - if (addrs == NULL) { - if (auth_required) - return 0; /* no addresses authorized */ - return allow_any_ip || !have_route_to(addr); - } + if (addrs == NULL) + return 0; /* no addresses authorized */ for (; addrs != NULL; addrs = addrs->next) { /* "-" means no addresses authorized, "*" means any address allowed */ -- 2.39.2