]> git.ozlabs.org Git - ppp.git/commitdiff
disable holdoff for reconnect on timeout or link failure (#538)
author[anp/hsw] <sysop@880.ru>
Mon, 30 Dec 2024 05:21:55 +0000 (12:21 +0700)
committerGitHub <noreply@github.com>
Mon, 30 Dec 2024 05:21:55 +0000 (16:21 +1100)
Signed-off-by: [anp/hsw] <sysop@880.ru>
pppd/auth.c
pppd/main.c
pppd/pppd.8

index a8fd1e6370f5f11e2892f53838e051f9cace8cdc..a78a697920f435da14e91d34aead7e76deb17058 100644 (file)
@@ -1325,6 +1325,7 @@ connect_time_expired(void *arg)
     info("Connect time expired");
     ppp_set_status(EXIT_CONNECT_TIME);
     lcp_close(0, "Connect time expired");      /* Close connection */
+    need_holdoff = 0;
 }
 
 /*
index 32ad489c2821ebc848c425cd7e7ade90168259c0..3b3fc4542f3fa4c46645f85f8f26752abab65d39 100644 (file)
@@ -607,8 +607,10 @@ main(int argc, char *argv[])
        while (phase != PHASE_DEAD) {
            handle_events();
            get_input();
-           if (kill_link)
+           if (kill_link) {
                lcp_close(0, "User request");
+               need_holdoff = 0;
+           }
            if (asked_to_quit) {
                bundle_terminating = 1;
                if (phase == PHASE_MASTER)
@@ -1149,6 +1151,7 @@ get_input(void)
        notice("Modem hangup");
        hungup = 1;
        code = EXIT_HANGUP;
+       need_holdoff = 0;
        lcp_lowerdown(0);       /* serial link is no longer available */
        link_terminated(0);
        return;
index d2c88e3cf82e60590c0cda149aff5ee8244425d9..3a787a0f5357048e4f354f7a7d3d1d743482a751 100644 (file)
@@ -475,7 +475,8 @@ exclude the password string from the log.  This is the default.
 Specifies how many seconds to wait before re-initiating the link after
 it terminates.  This option only has any effect if the \fIpersist\fR
 or \fIdemand\fR option is used.  The holdoff period is not applied if
-the link was terminated because it was idle.
+the link was terminated because it was idle, connect time expired,
+modem hangup or user request.
 .TP
 .B idle \fIn
 Specifies that pppd should disconnect if the link is idle for \fIn\fR