1 pppd: Do not clobber exit codes on hangup
3 When a modem hangup occurs, pppd unconditionally sets the exit status code
4 to EXIT_HANGUP. This patch only sets EXIT_HANGUP if the exit status code is
5 not already set to an error value.
7 The motiviation of this patch is to allow applications which remote control
8 pppd to react properly on errors, e.g. only redial (relaunch pppd) if there
9 was a hangup, but not if the CHAP authentication failed.
11 Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
15 @@ -1048,7 +1048,8 @@ get_input()
17 notice("Modem hangup");
19 - status = EXIT_HANGUP;
20 + if (status == EXIT_OK)
21 + status = EXIT_HANGUP;
22 lcp_lowerdown(0); /* serial link is no longer available */