summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--accel-pptpd/extra/pppd_compat.c14
-rw-r--r--driver/CMakeLists.txt13
-rw-r--r--driver/Makefile1
3 files changed, 21 insertions, 7 deletions
diff --git a/accel-pptpd/extra/pppd_compat.c b/accel-pptpd/extra/pppd_compat.c
index 9655269a..db46dd47 100644
--- a/accel-pptpd/extra/pppd_compat.c
+++ b/accel-pptpd/extra/pppd_compat.c
@@ -230,9 +230,9 @@ static void ev_ppp_finished(struct ppp_t *ppp)
char ipaddr[16];
char peer_ipaddr[16];
char peername[64];
- char connect_time[16];
- char bytes_sent[12];
- char bytes_rcvd[12];
+ char connect_time[24];
+ char bytes_sent[24];
+ char bytes_rcvd[24];
struct pppd_compat_pd_t *pd = find_pd(ppp);
if (!pd)
@@ -463,13 +463,13 @@ static void fill_argv(char **argv, struct ppp_t *ppp, char *path)
static void fill_env(char **env, struct pppd_compat_pd_t *pd)
{
- sprintf(env[0], "PEERNAME=%s", pd->ppp->username);
+ snprintf(env[0], 64, "PEERNAME=%s", pd->ppp->username);
if (pd->ppp->stop_time) {
- sprintf(env[1], "CONNECT_TIME=%lu", pd->ppp->stop_time - pd->ppp->start_time);
- sprintf(env[2], "BYTES_SENT=%u", pd->bytes_sent);
- sprintf(env[3], "BYTES_RCVD=%u", pd->bytes_rcvd);
+ snprintf(env[1], 24, "CONNECT_TIME=%lu", pd->ppp->stop_time - pd->ppp->start_time);
+ snprintf(env[2], 24, "BYTES_SENT=%u", pd->bytes_sent);
+ snprintf(env[3], 24, "BYTES_RCVD=%u", pd->bytes_rcvd);
}
}
diff --git a/driver/CMakeLists.txt b/driver/CMakeLists.txt
index 1daeb080..844cb5ac 100644
--- a/driver/CMakeLists.txt
+++ b/driver/CMakeLists.txt
@@ -14,5 +14,18 @@ ADD_CUSTOM_TARGET(pptp_drv ALL
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/driver/pptp.ko
)
+ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/driver/isg.ko
+ COMMAND rm -rf ${CMAKE_CURRENT_BINARY_DIR}/driver
+ COMMAND mkdir ${CMAKE_CURRENT_BINARY_DIR}/driver
+ COMMAND ln -sf ${CMAKE_CURRENT_SOURCE_DIR}/* ${CMAKE_CURRENT_BINARY_DIR}/driver
+ COMMAND make -C ${KDIR} M=${CMAKE_CURRENT_BINARY_DIR}/driver modules
+ DEPENDS isg.c
+)
+
+ADD_CUSTOM_TARGET(isg_drv ALL
+ DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/driver/isg.ko
+)
+
+
INSTALL(CODE "EXECUTE_PROCESS(COMMAND make -C ${KDIR} M=${CMAKE_CURRENT_BINARY_DIR}/driver modules_install)")
diff --git a/driver/Makefile b/driver/Makefile
index 8ccbbedf..fafc843e 100644
--- a/driver/Makefile
+++ b/driver/Makefile
@@ -1,4 +1,5 @@
obj-m += pptp.o
+obj-m += isg.o
default:
make -C $(KDIR) M=$(PWD) modules