diff options
author | Kozlov Dmitry <dima@server> | 2010-10-06 17:32:14 +0400 |
---|---|---|
committer | Kozlov Dmitry <dima@server> | 2010-10-06 17:32:14 +0400 |
commit | 194a3932ae14eca1c3b7ad37741de9f319d34da4 (patch) | |
tree | 42106cb685bb8b6df944c7bd1350f6b557230414 /driver | |
parent | 45b3c9c5bdd896f51f47e29069e3c030ddb17d51 (diff) | |
download | accel-ppp-194a3932ae14eca1c3b7ad37741de9f319d34da4.tar.gz accel-ppp-194a3932ae14eca1c3b7ad37741de9f319d34da4.zip |
forgotten rcu_dereference
Diffstat (limited to 'driver')
-rw-r--r-- | driver/CMakeLists.txt | 6 | ||||
-rw-r--r-- | driver/pptp.c | 10 |
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: |