Skip to content

Commit 48612dc

Browse files
committed
pppd: Remove dead check for existence of route to remote IP
The have_route_to() call in auth_ip_addr() is dead code, so remove it. It can never be reached because, to reach it, we would have to have !auth_required && !allow_any_ip && !privileged, but auth_check_options() sets auth_required to 1 in that case. In other words, the logic established by previous commits is this: If pppd is run by non-root and the noauth option isn't in effect, or if the auth option is given, the peer has to authenticate, and the IP addresses are controlled by the secrets file, with no reachability check. If pppd is run by root and authentication isn't required (i.e. the auth option is not given), the peer can use any IP address, with no reachability check. In neither case is the reachability check done by have_route_to() used. Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
1 parent bbf96e4 commit 48612dc

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

pppd/auth.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2143,7 +2143,7 @@ auth_ip_addr(int unit, u_int32_t addr)
21432143

21442144
if (auth_required)
21452145
return 0; /* no addresses authorized */
2146-
return allow_any_ip || privileged || !have_route_to(addr);
2146+
return allow_any_ip || privileged;
21472147
}
21482148

21492149
static int

0 commit comments

Comments
 (0)