diff options
author | Kozlov Dmitry <xeb@mail.ru> | 2013-01-11 16:27:49 +0400 |
---|---|---|
committer | Kozlov Dmitry <xeb@mail.ru> | 2013-01-11 16:27:49 +0400 |
commit | f1e3ddf8d12ccdc2d20976e5960985853bed6454 (patch) | |
tree | 098149e5ac79b02fba95464717e4c763add79d1e | |
parent | 3a68b66387b2e352d4ffe60c0dd4aeeb2c599fb4 (diff) | |
parent | c223aade3cd0c9ee651902f70da5497aae0f8014 (diff) | |
download | accel-ppp-f1e3ddf8d12ccdc2d20976e5960985853bed6454.tar.gz accel-ppp-f1e3ddf8d12ccdc2d20976e5960985853bed6454.zip |
Merge branch '1.7' of ssh://accel-ppp.git.sourceforge.net/gitroot/accel-ppp/accel-ppp into 1.7
-rw-r--r-- | accel-pppd/CMakeLists.txt | 23 | ||||
-rw-r--r-- | accel-pppd/auth/CMakeLists.txt | 2 | ||||
-rw-r--r-- | accel-pppd/ctrl/l2tp/CMakeLists.txt | 2 | ||||
-rw-r--r-- | accel-pppd/ctrl/pppoe/CMakeLists.txt | 6 | ||||
-rw-r--r-- | accel-pppd/ctrl/pptp/CMakeLists.txt | 2 | ||||
-rw-r--r-- | accel-pppd/extra/CMakeLists.txt | 6 | ||||
-rw-r--r-- | accel-pppd/extra/net-snmp/CMakeLists.txt | 2 | ||||
-rw-r--r-- | accel-pppd/ipv6/CMakeLists.txt | 2 | ||||
-rw-r--r-- | accel-pppd/logs/CMakeLists.txt | 8 | ||||
-rw-r--r-- | accel-pppd/ppp/lcp_opt_magic.c | 4 | ||||
-rw-r--r-- | accel-pppd/ppp/ppp_lcp.c | 8 | ||||
-rw-r--r-- | accel-pppd/radius/CMakeLists.txt | 2 | ||||
-rw-r--r-- | accel-pppd/radius/acct.c | 6 | ||||
-rw-r--r-- | accel-pppd/shaper/CMakeLists.txt | 2 | ||||
-rw-r--r-- | accel-pppd/triton/CMakeLists.txt | 4 |
15 files changed, 47 insertions, 32 deletions
diff --git a/accel-pppd/CMakeLists.txt b/accel-pppd/CMakeLists.txt index 0c1c949..2d1db49 100644 --- a/accel-pppd/CMakeLists.txt +++ b/accel-pppd/CMakeLists.txt @@ -15,6 +15,19 @@ ENDIF (EXISTS ${CMAKE_HOME_DIRECTORY}/.git AND NOT DEFINED IGNORE_GIT) ADD_DEFINITIONS(-DACCEL_PPP_VERSION="${ACCEL_PPP_VERSION}") +IF (NOT DEFINED LIB_SUFFIX) + EXECUTE_PROCESS( + COMMAND uname -m + COMMAND tr -d '\n' + OUTPUT_VARIABLE ARCH + ) + message(STATUS "'" ${ARCH} "'") + IF (ARCH STREQUAL x86_64) + SET(LIB_SUFFIX 64) + ENDIF (ARCH STREQUAL x86_64) +ENDIF (NOT DEFINED LIB_SUFFIX) + + INCLUDE_DIRECTORIES(include) IF (MEMDEBUG) @@ -93,7 +106,7 @@ TARGET_LINK_LIBRARIES(accel-pppd triton rt pthread ${crypto_lib} pcre) set_property(TARGET accel-pppd PROPERTY CMAKE_SKIP_BUILD_RPATH FALSE) set_property(TARGET accel-pppd PROPERTY CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) set_property(TARGET accel-pppd PROPERTY INSTALL_RPATH_USE_LINK_PATH FALSE) -set_property(TARGET accel-pppd PROPERTY INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib/accel-ppp) +set_property(TARGET accel-pppd PROPERTY INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib${LIB_SIFFIX}/accel-ppp) INSTALL(TARGETS accel-pppd RUNTIME DESTINATION sbin @@ -102,10 +115,10 @@ INSTALL(TARGETS accel-pppd INSTALL(FILES accel-ppp.conf.5 DESTINATION share/man/man5) IF (NOT DEFINED CPACK_TYPE) - INSTALL(FILES accel-ppp.conf DESTINATION /etc RENAME accel-ppp.conf.dist) + INSTALL(FILES accel-ppp.conf DESTINATION ${CMAKE_FIND_ROOT_PATH}/etc RENAME accel-ppp.conf.dist) - INSTALL(CODE "EXECUTE_PROCESS(COMMAND mkdir -p /var/log/accel-ppp)") - INSTALL(CODE "EXECUTE_PROCESS(COMMAND mkdir -p /var/run/accel-ppp)") - INSTALL(CODE "EXECUTE_PROCESS(COMMAND 'echo 0 > /var/run/accel-ppp/seq')") + INSTALL(CODE "EXECUTE_PROCESS(COMMAND mkdir -p ${CMAKE_FIND_ROOT_PATH}/var/log/accel-ppp)") + INSTALL(CODE "EXECUTE_PROCESS(COMMAND mkdir -p ${CMAKE_FIND_ROOT_PATH}/var/run/accel-ppp)") + INSTALL(CODE "EXECUTE_PROCESS(COMMAND 'echo 0 > ${CMAKE_FIND_ROOT_PATH}/var/run/accel-ppp/seq')") ENDIF (NOT DEFINED CPACK_TYPE) diff --git a/accel-pppd/auth/CMakeLists.txt b/accel-pppd/auth/CMakeLists.txt index 7af8fac..f93d9e3 100644 --- a/accel-pppd/auth/CMakeLists.txt +++ b/accel-pppd/auth/CMakeLists.txt @@ -8,6 +8,6 @@ TARGET_LINK_LIBRARIES(auth_mschap_v1 ${crypto_lib}) TARGET_LINK_LIBRARIES(auth_mschap_v2 ${crypto_lib}) INSTALL(TARGETS auth_pap auth_chap_md5 auth_mschap_v1 auth_mschap_v2 - LIBRARY DESTINATION lib/accel-ppp + LIBRARY DESTINATION lib${LIB_SUFFIX}/accel-ppp ) diff --git a/accel-pppd/ctrl/l2tp/CMakeLists.txt b/accel-pppd/ctrl/l2tp/CMakeLists.txt index b295289..66dd3fc 100644 --- a/accel-pppd/ctrl/l2tp/CMakeLists.txt +++ b/accel-pppd/ctrl/l2tp/CMakeLists.txt @@ -10,7 +10,7 @@ ADD_LIBRARY(l2tp SHARED ) #TARGET_LINK_LIBRARIES(l2tp nl nl-genl) -INSTALL(TARGETS l2tp LIBRARY DESTINATION lib/accel-ppp) +INSTALL(TARGETS l2tp LIBRARY DESTINATION lib${LIB_SUFFIX}/accel-ppp) FILE(GLOB dict "${CMAKE_CURRENT_SOURCE_DIR}/dict/*") INSTALL(FILES ${dict} DESTINATION share/accel-ppp/l2tp) diff --git a/accel-pppd/ctrl/pppoe/CMakeLists.txt b/accel-pppd/ctrl/pppoe/CMakeLists.txt index a38cfb2..fad9efd 100644 --- a/accel-pppd/ctrl/pppoe/CMakeLists.txt +++ b/accel-pppd/ctrl/pppoe/CMakeLists.txt @@ -13,9 +13,5 @@ ENDIF(RADIUS) ADD_LIBRARY(pppoe SHARED ${sources}) TARGET_LINK_LIBRARIES(pppoe ${crypto_lib}) -#set_property(TARGET pppoe PROPERTY CMAKE_SKIP_BUILD_RPATH FALSE) -#set_property(TARGET pppoe PROPERTY CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) -#set_property(TARGET pppoe PROPERTY INSTALL_RPATH_USE_LINK_PATH FALSE) -#set_property(TARGET pppoe PROPERTY INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib/accel-ppp) -INSTALL(TARGETS pppoe LIBRARY DESTINATION lib/accel-ppp) +INSTALL(TARGETS pppoe LIBRARY DESTINATION lib${LIB_SUFFIX}/accel-ppp) diff --git a/accel-pppd/ctrl/pptp/CMakeLists.txt b/accel-pppd/ctrl/pptp/CMakeLists.txt index 3199e7f..aa011d1 100644 --- a/accel-pppd/ctrl/pptp/CMakeLists.txt +++ b/accel-pppd/ctrl/pptp/CMakeLists.txt @@ -2,4 +2,4 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) ADD_LIBRARY(pptp SHARED pptp.c) -INSTALL(TARGETS pptp LIBRARY DESTINATION lib/accel-ppp ) +INSTALL(TARGETS pptp LIBRARY DESTINATION lib${LIB_SUFFIX}/accel-ppp ) diff --git a/accel-pppd/extra/CMakeLists.txt b/accel-pppd/extra/CMakeLists.txt index cbaef49..43ba367 100644 --- a/accel-pppd/extra/CMakeLists.txt +++ b/accel-pppd/extra/CMakeLists.txt @@ -1,6 +1,6 @@ ADD_LIBRARY(pppd_compat SHARED pppd_compat.c) TARGET_LINK_LIBRARIES(pppd_compat sigchld) -set_property(TARGET pppd_compat PROPERTY INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib/accel-ppp) +set_property(TARGET pppd_compat PROPERTY INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/accel-ppp) ADD_LIBRARY(ippool SHARED ippool.c) ADD_LIBRARY(ipv6pool SHARED ipv6pool.c) ADD_LIBRARY(sigchld SHARED sigchld.c) @@ -10,7 +10,7 @@ TARGET_LINK_LIBRARIES(logwtmp util) ADD_LIBRARY(connlimit SHARED connlimit.c) INSTALL(TARGETS pppd_compat ippool ipv6pool sigchld chap-secrets logwtmp connlimit - LIBRARY DESTINATION lib/accel-ppp + LIBRARY DESTINATION lib${LIB_SUFFIX}/accel-ppp ) IF (SHAPER) @@ -20,7 +20,7 @@ IF (SHAPER) SET_PROPERTY(TARGET shaper_tbf PROPERTY LINK_FLAGS "-L${LIBNL_PREFIX}/lib") ENDIF (LIBNL_PREFIX) TARGET_LINK_LIBRARIES(shaper_tbf nl m) - INSTALL(TARGETS shaper_tbf LIBRARY DESTINATION lib/accel-ppp) + INSTALL(TARGETS shaper_tbf LIBRARY DESTINATION lib${LIB_SUFFIX}/accel-ppp) ENDIF (SHAPER) diff --git a/accel-pppd/extra/net-snmp/CMakeLists.txt b/accel-pppd/extra/net-snmp/CMakeLists.txt index b61c0d0..7633f37 100644 --- a/accel-pppd/extra/net-snmp/CMakeLists.txt +++ b/accel-pppd/extra/net-snmp/CMakeLists.txt @@ -25,5 +25,5 @@ IF (NETSNMP_PREFIX) ENDIF (NETSNMP_PREFIX) INSTALL(TARGETS net-snmp - LIBRARY DESTINATION lib/accel-ppp + LIBRARY DESTINATION lib${LIB_SUFFIX}/accel-ppp ) diff --git a/accel-pppd/ipv6/CMakeLists.txt b/accel-pppd/ipv6/CMakeLists.txt index 9f8c3d1..e95eadb 100644 --- a/accel-pppd/ipv6/CMakeLists.txt +++ b/accel-pppd/ipv6/CMakeLists.txt @@ -2,6 +2,6 @@ ADD_LIBRARY(ipv6_dhcp SHARED dhcpv6.c dhcpv6_packet.c) ADD_LIBRARY(ipv6_nd SHARED nd.c) INSTALL(TARGETS ipv6_dhcp ipv6_nd - LIBRARY DESTINATION lib/accel-ppp + LIBRARY DESTINATION lib${LIB_SUFFIX}/accel-ppp ) diff --git a/accel-pppd/logs/CMakeLists.txt b/accel-pppd/logs/CMakeLists.txt index b10163f..b25cbe2 100644 --- a/accel-pppd/logs/CMakeLists.txt +++ b/accel-pppd/logs/CMakeLists.txt @@ -15,21 +15,21 @@ IF(LOG_FILE) ADD_LIBRARY(log_file SHARED log_file.c) TARGET_LINK_LIBRARIES(log_file rt) INSTALL(TARGETS log_file - LIBRARY DESTINATION lib/accel-ppp + LIBRARY DESTINATION lib${LIB_SUFFIX}/accel-ppp ) ENDIF(LOG_FILE) IF(LOG_TCP) ADD_LIBRARY(log_tcp SHARED log_tcp.c) INSTALL(TARGETS log_tcp - LIBRARY DESTINATION lib/accel-ppp + LIBRARY DESTINATION lib${LIB_SUFFIX}/accel-ppp ) ENDIF(LOG_TCP) IF(LOG_SYSLOG) ADD_LIBRARY(log_syslog SHARED log_syslog.c) INSTALL(TARGETS log_syslog - LIBRARY DESTINATION lib/accel-ppp + LIBRARY DESTINATION lib${LIB_SUFFIX}/accel-ppp ) ENDIF(LOG_SYSLOG) @@ -37,7 +37,7 @@ IF(LOG_PGSQL) ADD_LIBRARY(log_pgsql SHARED log_pgsql.c) TARGET_LINK_LIBRARIES(log_pgsql pq) INSTALL(TARGETS log_pgsql - LIBRARY DESTINATION lib/accel-ppp + LIBRARY DESTINATION lib${LIB_SUFFIX}/accel-ppp ) ENDIF(LOG_PGSQL) diff --git a/accel-pppd/ppp/lcp_opt_magic.c b/accel-pppd/ppp/lcp_opt_magic.c index 3e694d2..bf39209 100644 --- a/accel-pppd/ppp/lcp_opt_magic.c +++ b/accel-pppd/ppp/lcp_opt_magic.c @@ -94,9 +94,9 @@ static void magic_print(void (*print)(const char *fmt,...),struct lcp_option_t * struct lcp_opt32_t *opt32 = (struct lcp_opt32_t *)ptr; if (ptr) - print("<magic %04x>", ntohl(opt32->val)); + print("<magic %08x>", ntohl(opt32->val)); else - print("<magic %04x>", magic_opt->magic); + print("<magic %08x>", magic_opt->magic); } static void magic_opt_init() diff --git a/accel-pppd/ppp/ppp_lcp.c b/accel-pppd/ppp/ppp_lcp.c index e1727de..7a071dd 100644 --- a/accel-pppd/ppp/ppp_lcp.c +++ b/accel-pppd/ppp/ppp_lcp.c @@ -606,7 +606,7 @@ static void lcp_recv_echo_repl(struct ppp_lcp_t *lcp, uint8_t *data, int size) magic = ntohl(*(uint32_t *)data); if (conf_ppp_verbose) - log_ppp_debug("recv [LCP EchoRep id=%x <magic %x>]\n", lcp->fsm.recv_id, magic); + log_ppp_debug("recv [LCP EchoRep id=%x <magic %08x>]\n", lcp->fsm.recv_id, magic); if (magic == lcp->magic) { log_ppp_error("lcp: echo: loop-back detected\n"); @@ -630,7 +630,7 @@ static void send_echo_reply(struct ppp_lcp_t *lcp) *(uint32_t *)(hdr + 1) = htonl(lcp->magic); if (conf_ppp_verbose) - log_ppp_debug("send [LCP EchoRep id=%x <magic %x>]\n", hdr->id, htonl(lcp->magic)); + log_ppp_debug("send [LCP EchoRep id=%x <magic %08x>]\n", hdr->id, lcp->magic); ppp_chan_send(lcp->ppp, hdr, ntohs(hdr->len) + 2); } @@ -683,7 +683,7 @@ static void send_echo_request(struct triton_timer_t *t) } if (conf_ppp_verbose) - log_ppp_debug("send [LCP EchoReq id=%x <magic %x>]\n", msg.hdr.id, lcp->magic); + log_ppp_debug("send [LCP EchoReq id=%x <magic %08x>]\n", msg.hdr.id, lcp->magic); ppp_chan_send(lcp->ppp,&msg,ntohs(msg.hdr.len)+2); } @@ -851,7 +851,7 @@ static void lcp_recv(struct ppp_handler_t*h) break; case ECHOREQ: if (conf_ppp_verbose) - log_ppp_debug("recv [LCP EchoReq id=%x <magic %x>]\n", hdr->id, ntohl(*(uint32_t*)(hdr + 1))); + log_ppp_debug("recv [LCP EchoReq id=%x <magic %08x>]\n", hdr->id, ntohl(*(uint32_t*)(hdr + 1))); send_echo_reply(lcp); break; case ECHOREP: diff --git a/accel-pppd/radius/CMakeLists.txt b/accel-pppd/radius/CMakeLists.txt index 0c1789e..566f3f9 100644 --- a/accel-pppd/radius/CMakeLists.txt +++ b/accel-pppd/radius/CMakeLists.txt @@ -15,7 +15,7 @@ ADD_DEFINITIONS(-DDICTIONARY="${CMAKE_INSTALL_PREFIX}/share/accel-ppp/radius/dic ADD_LIBRARY(radius SHARED ${sources}) INSTALL(TARGETS radius - LIBRARY DESTINATION lib/accel-ppp + LIBRARY DESTINATION lib${LIB_SUFFIX}/accel-ppp ) FILE(GLOB dict "${CMAKE_CURRENT_SOURCE_DIR}/dict/*") INSTALL(FILES ${dict} DESTINATION share/accel-ppp/radius) diff --git a/accel-pppd/radius/acct.c b/accel-pppd/radius/acct.c index 9a832a9..43e5549 100644 --- a/accel-pppd/radius/acct.c +++ b/accel-pppd/radius/acct.c @@ -202,6 +202,12 @@ static void rad_acct_interim_update(struct triton_timer_t *t) req_set_RA(rpd->acct_req, rpd->acct_req->serv->secret); __rad_req_send(rpd->acct_req); + /* The above call may set rpd->acct_req to NULL in the following chain of events: + 1. __rad_req_send fails (on rad_server_realloc) and calls ppp_terminate; + 2. As a result, an EV_PPP_FINISHING event is fired; + 3. ppp_finishing calls rad_acct_stop that cleans up the request. */ + if (!rpd->acct_req) + return; __sync_add_and_fetch(&rpd->acct_req->serv->stat_interim_sent, 1); diff --git a/accel-pppd/shaper/CMakeLists.txt b/accel-pppd/shaper/CMakeLists.txt index 3c1ac95..7f211fd 100644 --- a/accel-pppd/shaper/CMakeLists.txt +++ b/accel-pppd/shaper/CMakeLists.txt @@ -1,6 +1,6 @@ ADD_LIBRARY(shaper SHARED shaper.c limiter.c leaf_qdisc.c tc_core.c) INSTALL(TARGETS shaper - LIBRARY DESTINATION lib/accel-ppp + LIBRARY DESTINATION lib${LIB_SUFFIX}/accel-ppp ) diff --git a/accel-pppd/triton/CMakeLists.txt b/accel-pppd/triton/CMakeLists.txt index 105b62a..0dc7ba5 100644 --- a/accel-pppd/triton/CMakeLists.txt +++ b/accel-pppd/triton/CMakeLists.txt @@ -30,11 +30,11 @@ ENDIF (HAVE_TIMERFD) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) -ADD_DEFINITIONS(-DMODULE_PATH="${CMAKE_INSTALL_PREFIX}/lib/accel-ppp") +ADD_DEFINITIONS(-DMODULE_PATH="${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/accel-ppp") ADD_LIBRARY(triton SHARED ${sources_c}) TARGET_LINK_LIBRARIES(triton dl) INSTALL(TARGETS triton - LIBRARY DESTINATION lib/accel-ppp + LIBRARY DESTINATION lib${LIB_SUFFIX}/accel-ppp ) |