Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix reliability of print_link_stats (with option persist) #505

Merged
merged 1 commit into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pppd/ipcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2026,7 +2026,7 @@ ipcp_down(fsm *f)
sifvjcomp(f->unit, 0, 0, 0);

print_link_stats(); /* _after_ running the notifiers and ip_down_hook(),
* because print_link_stats() sets link_stats_valid
* because print_link_stats() sets link_stats_print
* to 0 (zero) */

/*
Expand Down
4 changes: 2 additions & 2 deletions pppd/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1331,9 +1331,9 @@ print_link_stats(void)
void
reset_link_stats(int u)
{
if (!get_ppp_stats(u, &old_link_stats))
return;
get_ppp_stats(u, &old_link_stats);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we initialize old_link_stats to all zeroes if the get_ppp_stats call fails? Or copy it from link_stats?

ppp_get_time(&start_time);
link_stats_print = 1;
}

/*
Expand Down