diff options
-rw-r--r-- | accel-pppd/cli/show_sessions.c | 6 | ||||
-rw-r--r-- | accel-pppd/ctrl/ipoe/ipoe.c | 2 | ||||
-rw-r--r-- | accel-pppd/ctrl/ipoe/ipoe_netlink.c | 2 | ||||
-rw-r--r-- | accel-pppd/vlan-mon/vlan_mon.c | 2 |
4 files changed, 6 insertions, 6 deletions
diff --git a/accel-pppd/cli/show_sessions.c b/accel-pppd/cli/show_sessions.c index 0ea3c94e..10e16b13 100644 --- a/accel-pppd/cli/show_sessions.c +++ b/accel-pppd/cli/show_sessions.c @@ -475,7 +475,7 @@ static void print_uptime(struct ap_session *ses, char *buf) { time_t uptime; int day,hour,min,sec; - char time_str[14]; + char time_str[24]; if (ses->stop_time) uptime = ses->stop_time - ses->start_time; @@ -489,9 +489,9 @@ static void print_uptime(struct ap_session *ses, char *buf) min = uptime / 60; sec = uptime % 60; if (day) - snprintf(time_str, 13, "%i.%02i:%02i:%02i", day, hour, min, sec); + snprintf(time_str, sizeof(time_str), "%i.%02i:%02i:%02i", day, hour, min, sec); else - snprintf(time_str, 13, "%02i:%02i:%02i", hour, min, sec); + snprintf(time_str, sizeof(time_str), "%02i:%02i:%02i", hour, min, sec); sprintf(buf, "%s", time_str); } diff --git a/accel-pppd/ctrl/ipoe/ipoe.c b/accel-pppd/ctrl/ipoe/ipoe.c index eb06e7b7..6155ccb3 100644 --- a/accel-pppd/ctrl/ipoe/ipoe.c +++ b/accel-pppd/ctrl/ipoe/ipoe.c @@ -1514,7 +1514,7 @@ static void ipoe_serv_disc_timer(struct triton_timer_t *t) { struct ipoe_serv *serv = container_of(t, typeof(*serv), disc_timer); struct timespec ts; - int delay, delay1 = INT_MAX, delay2 = INT_MAX, offer_delay; + int delay, delay1 = INT_MAX, delay2 = INT_MAX, offer_delay = 0; clock_gettime(CLOCK_MONOTONIC, &ts); diff --git a/accel-pppd/ctrl/ipoe/ipoe_netlink.c b/accel-pppd/ctrl/ipoe/ipoe_netlink.c index 4331e804..e42bf34c 100644 --- a/accel-pppd/ctrl/ipoe/ipoe_netlink.c +++ b/accel-pppd/ctrl/ipoe/ipoe_netlink.c @@ -626,7 +626,7 @@ static void init(void) { int mcg_id; - if (system("modprobe -q ipoe")) + if (access("/sys/module/ipoe", F_OK) && system("modprobe -q ipoe")) log_warn("failed to load ipoe module\n"); mcg_id = genl_resolve_mcg(IPOE_GENL_NAME, IPOE_GENL_MCG_PKT, &ipoe_genl_id); diff --git a/accel-pppd/vlan-mon/vlan_mon.c b/accel-pppd/vlan-mon/vlan_mon.c index 2892f4f3..f2109eda 100644 --- a/accel-pppd/vlan-mon/vlan_mon.c +++ b/accel-pppd/vlan-mon/vlan_mon.c @@ -522,7 +522,7 @@ static void init(void) { int mcg_id; - if (system("modprobe -q vlan_mon")) + if (access("/sys/module/vlan_mon", F_OK) && system("modprobe -q vlan_mon")) log_warn("failed to load vlan_mon module\n"); mcg_id = genl_resolve_mcg(VLAN_MON_GENL_NAME, VLAN_MON_GENL_MCG, &vlan_mon_genl_id); |