Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/net Remove open event on tlf of PAP/CHAP when retry of t...



details:   https://anonhg.NetBSD.org/src/rev/b8e8c925c18b
branches:  trunk
changeset: 983662:b8e8c925c18b
user:      yamaguchi <yamaguchi%NetBSD.org@localhost>
date:      Tue Jun 01 04:45:22 2021 +0000

description:
Remove open event on tlf of PAP/CHAP when retry of them is over
to prevent that LCP stops at Starting state.

And also remove retry counter check on tls of LCP because of
unnecessary.

diffstat:

 sys/net/if_spppsubr.c |  27 ++++++++++++++-------------
 1 files changed, 14 insertions(+), 13 deletions(-)

diffs (55 lines):

diff -r e86c860ce8ff -r b8e8c925c18b sys/net/if_spppsubr.c
--- a/sys/net/if_spppsubr.c     Tue Jun 01 04:19:57 2021 +0000
+++ b/sys/net/if_spppsubr.c     Tue Jun 01 04:45:22 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_spppsubr.c,v 1.249 2021/06/01 04:19:57 yamaguchi Exp $       */
+/*     $NetBSD: if_spppsubr.c,v 1.250 2021/06/01 04:45:22 yamaguchi Exp $       */
 
 /*
  * Synchronous PPP/Cisco link level subroutines.
@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_spppsubr.c,v 1.249 2021/06/01 04:19:57 yamaguchi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_spppsubr.c,v 1.250 2021/06/01 04:45:22 yamaguchi Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -3477,16 +3477,6 @@
 
        KASSERT(SPPP_WLOCKED(sp));
 
-       if (sp->pp_max_auth_fail != 0 && sp->pp_auth_failures >= sp->pp_max_auth_fail) {
-               printf("%s: authentication failed %d times, not retrying again\n",
-               sp->pp_if.if_xname, sp->pp_auth_failures);
-
-               SPPP_UNLOCK(sp);
-               if_down(&sp->pp_if);
-               SPPP_LOCK(sp, RW_WRITER);
-               return;
-       }
-
        sppp_change_phase(sp, SPPP_PHASE_ESTABLISH);
 
        /* Notify lower layer if desired. */
@@ -3597,7 +3587,18 @@
                return;
 
        sppp_wq_add(sp->wq_cp, &sp->scp[IDX_LCP].work_close);
-       sppp_wq_add(sp->wq_cp, &sp->scp[IDX_LCP].work_open);
+
+       if (sp->pp_max_auth_fail != 0 &&
+           sp->pp_auth_failures >= sp->pp_max_auth_fail) {
+               printf("%s: authentication failed %d times, "
+                   "not retrying again\n",
+               sp->pp_if.if_xname, sp->pp_auth_failures);
+
+               sppp_wq_add(sp->wq_cp, &sp->work_ifdown);
+               sp->pp_if.if_flags &= ~IFF_RUNNING;
+       } else {
+               sppp_wq_add(sp->wq_cp, &sp->scp[IDX_LCP].work_open);
+       }
 }
 
 /*



Home | Main Index | Thread Index | Old Index