summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--driver/CMakeLists.txt6
-rw-r--r--driver/pptp.c10
2 files changed, 11 insertions, 5 deletions
diff --git a/driver/CMakeLists.txt b/driver/CMakeLists.txt
index e9d511a9..1daeb080 100644
--- a/driver/CMakeLists.txt
+++ b/driver/CMakeLists.txt
@@ -3,11 +3,11 @@ if (NOT DEFINED KDIR)
endif (NOT DEFINED KDIR)
ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/driver/pptp.ko
- COMMAND mkdir ${CMAKE_CURRENT_BINARY_DIR}/driver &> /dev/null
+ 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
-# COMMAND cp ${CMAKE_CURRENT_SOURCE_DIR}/pptp.ko ${CMAKE_CURRENT_BINARY_DIR}/pptp.ko
-# COMMAND make -C ${KDIR} M=${CMAKE_CURRENT_SOURCE_DIR} clean
+ DEPENDS pptp.c
)
ADD_CUSTOM_TARGET(pptp_drv ALL
diff --git a/driver/pptp.c b/driver/pptp.c
index 696d4075..58eb3076 100644
--- a/driver/pptp.c
+++ b/driver/pptp.c
@@ -50,7 +50,7 @@
#include "gre.h"
#endif
-#define PPTP_DRIVER_VERSION "0.8.5-rc1"
+#define PPTP_DRIVER_VERSION "0.8.5"
static int log_level=0;
static int log_packets=10;
@@ -274,7 +274,13 @@ static int lookup_chan_dst(u16 call_id, __be32 d_addr)
#endif
for(i = find_next_bit(callid_bitmap,MAX_CALLID,1); i < MAX_CALLID;
i = find_next_bit(callid_bitmap, MAX_CALLID, i + 1)){
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0)
+ sock = rcu_dereference(callid_sock[i]);
+#else
sock = callid_sock[i];
+#endif
+ if (!sock)
+ continue;
opt = &sock->proto.pptp;
if (opt->dst_addr.call_id == call_id && opt->dst_addr.sin_addr.s_addr == d_addr) break;
}
@@ -308,12 +314,12 @@ static int add_chan(struct pppox_sock *sock)
else if (test_bit(sock->proto.pptp.src_addr.call_id,callid_bitmap))
goto exit;
- set_bit(sock->proto.pptp.src_addr.call_id,callid_bitmap);
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0)
rcu_assign_pointer(callid_sock[sock->proto.pptp.src_addr.call_id],sock);
#else
callid_sock[sock->proto.pptp.src_addr.call_id] = sock;
#endif
+ set_bit(sock->proto.pptp.src_addr.call_id,callid_bitmap);
res=0;
exit: