Skip to content

Commit

Permalink
disable holdoff for reconnect on timeout or link failure (#538)
Browse files Browse the repository at this point in the history
Signed-off-by: [anp/hsw] <[email protected]>
  • Loading branch information
anphsw authored Dec 30, 2024
1 parent 9559491 commit 5efd40c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions pppd/auth.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/*
Expand Down
5 changes: 4 additions & 1 deletion pppd/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion pppd/pppd.8
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5efd40c

Please sign in to comment.