PPP, SERVER: fix build if PAP_SUPPORT is not enabled

If PAP_SUPPORT is not enabled, we can't consider a failed PAP auth as
a null auth.
This commit is contained in:
Sylvain Rochet 2016-07-02 20:02:47 +02:00
parent f21aede031
commit b97c4d96e2

View File

@ -728,7 +728,9 @@ void link_established(ppp_pcb *pcb) {
#if PPP_AUTH_SUPPORT
int auth;
#if PPP_SERVER
#if PAP_SUPPORT
lcp_options *wo = &pcb->lcp_wantoptions;
#endif /* PAP_SUPPORT */
lcp_options *go = &pcb->lcp_gotoptions;
#endif /* PPP_SERVER */
lcp_options *ho = &pcb->lcp_hisoptions;
@ -777,7 +779,11 @@ void link_established(ppp_pcb *pcb) {
set_allowed_addrs(unit, NULL, NULL);
} else
#endif /* PPP_ALLOWED_ADDRS */
if (!wo->neg_upap || !pcb->settings.null_login) {
if (!pcb->settings.null_login
#if PAP_SUPPORT
|| !wo->neg_upap
#endif /* PAP_SUPPORT */
) {
ppp_warn("peer refused to authenticate: terminating link");
#if 0 /* UNUSED */
status = EXIT_PEER_AUTH_FAILED;