From cf27bf49df5243237acb15389fb5544f5a863685 Mon Sep 17 00:00:00 2001 From: Dmitry Kozlov Date: Thu, 23 May 2013 21:57:16 +0400 Subject: cli: fixed 'restart' command (do soft restart, i.e. terminate sessions by default) --- accel-pppd/cli/std_cmd.c | 16 ++++++++-------- accel-pppd/ctrl/ipoe/ipoe.c | 3 --- 2 files changed, 8 insertions(+), 11 deletions(-) (limited to 'accel-pppd') diff --git a/accel-pppd/cli/std_cmd.c b/accel-pppd/cli/std_cmd.c index 7a890d1..38198a2 100644 --- a/accel-pppd/cli/std_cmd.c +++ b/accel-pppd/cli/std_cmd.c @@ -343,13 +343,17 @@ static void reload_help(char * const *fields, int fields_cnt, void *client) static void __do_restart(void) { +#ifdef USE_BACKUP core_restart(0); +#else + core_restart(1); +#endif _exit(0); } static int restart_exec(const char *cmd, char * const *f, int f_cnt, void *cli) { - int hard; + int hard = 0; if (f_cnt == 2) { if (strcmp(f[1], "soft") == 0) @@ -365,16 +369,12 @@ static int restart_exec(const char *cmd, char * const *f, int f_cnt, void *cli) else return CLI_CMD_SYNTAX; -#ifndef USE_BACKUP - hard = 1; -#endif - if (hard) { - ap_shutdown_soft(__do_restart); - terminate_all_sessions(0); - } else { core_restart(1); _exit(0); + } else { + ap_shutdown_soft(__do_restart); + terminate_all_sessions(0); } return CLI_CMD_OK; diff --git a/accel-pppd/ctrl/ipoe/ipoe.c b/accel-pppd/ctrl/ipoe/ipoe.c index 65b526f..7fcfa26 100644 --- a/accel-pppd/ctrl/ipoe/ipoe.c +++ b/accel-pppd/ctrl/ipoe/ipoe.c @@ -570,9 +570,6 @@ static void ipoe_ifcfg_del(struct ipoe_session *ses) log_ppp_warn("ipoe: failed to delete route from interface '%s'\n", serv->ifname); if (ses->serv->opt_ifcfg) { - if (iproute_del(serv->ifindex, ses->yiaddr)) - log_ppp_warn("ipoe: failed to delete route from interface '%s'\n", serv->ifname); - if (ses->serv->opt_shared) { ipoe_serv_del_addr(ses->serv, ses->siaddr); } else { -- cgit v1.2.3