diff options
author | Kozlov Dmitry <xeb@mail.ru> | 2012-05-16 00:02:43 +0400 |
---|---|---|
committer | Kozlov Dmitry <xeb@mail.ru> | 2012-05-16 00:02:43 +0400 |
commit | 4fb9e3f03506695023d6aac0106b7f541b820c80 (patch) | |
tree | 307d8e8fe35612c8794484d23f68b76bf5a4df84 /accel-pppd | |
parent | d669038e70d2e3690423792e63b8179e44a7a340 (diff) | |
download | accel-ppp-4fb9e3f03506695023d6aac0106b7f541b820c80.tar.gz accel-ppp-4fb9e3f03506695023d6aac0106b7f541b820c80.zip |
write message to log if unable to load necessary kernel module
Diffstat (limited to 'accel-pppd')
-rw-r--r-- | accel-pppd/ctrl/l2tp/l2tp.c | 3 | ||||
-rw-r--r-- | accel-pppd/ctrl/pppoe/pppoe.c | 3 | ||||
-rw-r--r-- | accel-pppd/ctrl/pptp/pptp.c | 3 | ||||
-rw-r--r-- | accel-pppd/shaper/limiter.c | 3 |
4 files changed, 8 insertions, 4 deletions
diff --git a/accel-pppd/ctrl/l2tp/l2tp.c b/accel-pppd/ctrl/l2tp/l2tp.c index 65cf456..1ec2daa 100644 --- a/accel-pppd/ctrl/l2tp/l2tp.c +++ b/accel-pppd/ctrl/l2tp/l2tp.c @@ -1165,7 +1165,8 @@ static void load_config(void) static void l2tp_init(void) { - system("modprobe pppol2tp &> /dev/null || modprobe l2tp_ppp &> /dev/null"); + if (system("modprobe -q pppol2tp || modprobe -q l2tp_ppp")) + log_warn("unable to load l2tp kernel module\n"); l2tp_conn = malloc(L2TP_MAX_TID * sizeof(void *)); memset(l2tp_conn, 0, L2TP_MAX_TID * sizeof(void *)); diff --git a/accel-pppd/ctrl/pppoe/pppoe.c b/accel-pppd/ctrl/pppoe/pppoe.c index 43dc643..41a0924 100644 --- a/accel-pppd/ctrl/pppoe/pppoe.c +++ b/accel-pppd/ctrl/pppoe/pppoe.c @@ -1429,7 +1429,8 @@ static void pppoe_init(void) struct conf_sect_t *s = conf_get_section("pppoe"); struct conf_option_t *opt; - system("modprobe pppoe"); + if (system("modprobe -q pppoe")) + log_warn("failed to load pppoe kernel module\n"); conn_pool = mempool_create(sizeof(struct pppoe_conn_t)); pado_pool = mempool_create(sizeof(struct delayed_pado_t)); diff --git a/accel-pppd/ctrl/pptp/pptp.c b/accel-pppd/ctrl/pptp/pptp.c index 456b85a..2f0c5ef 100644 --- a/accel-pppd/ctrl/pptp/pptp.c +++ b/accel-pppd/ctrl/pptp/pptp.c @@ -762,7 +762,8 @@ static void pptp_init(void) struct sockaddr_in addr; char *opt; - system("modprobe pptp"); + if (system("modprobe -q pptp")) + log_warn("failed to load pptp kernel module\n"); serv.hnd.fd = socket(PF_INET, SOCK_STREAM, 0); if (serv.hnd.fd < 0) { diff --git a/accel-pppd/shaper/limiter.c b/accel-pppd/shaper/limiter.c index 92e343b..5a3142b 100644 --- a/accel-pppd/shaper/limiter.c +++ b/accel-pppd/shaper/limiter.c @@ -488,7 +488,8 @@ int init_ifb(const char *name) .qdisc = qdisc_htb_root, }; - system("modprobe ifb"); + if (system("modprobe -q ifb")) + log_warn("failed to load ifb kernel module\n"); memset(&ifr, 0, sizeof(ifr)); strcpy(ifr.ifr_name, name); |