pppd: Remove dead check for existence of route to remote IP#585
Merged
Conversation
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>
Member
|
@jkroonza: Have you seen this @paulusmack PR? |
Contributor
|
I have not, but the logic sounds OK. It does make me think we should require an explicit auth or noauth to be provided though, or auth should be default. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.