summaryrefslogtreecommitdiff
path: root/accel-pptpd/ctrl
diff options
context:
space:
mode:
authorKozlov Dmitry <dima@server>2010-10-14 14:30:53 +0400
committerKozlov Dmitry <dima@server>2010-10-14 14:30:53 +0400
commit84ff56a83a9f6b29d3300aff13ede9afc73b5a68 (patch)
tree9284cb5b797dd7d68350cd937da11cc2f579114f /accel-pptpd/ctrl
parent763fe9e3ba0faeea25cc423152a065900f901a53 (diff)
downloadaccel-ppp-xebd-84ff56a83a9f6b29d3300aff13ede9afc73b5a68.tar.gz
accel-ppp-xebd-84ff56a83a9f6b29d3300aff13ede9afc73b5a68.zip
due to libnl-1 is not thread safe, l2tp and shaper updated to use libnl-2
Diffstat (limited to 'accel-pptpd/ctrl')
-rw-r--r--accel-pptpd/ctrl/CMakeLists.txt6
-rw-r--r--accel-pptpd/ctrl/l2tp/CMakeLists.txt2
-rw-r--r--accel-pptpd/ctrl/l2tp/netlink.c22
3 files changed, 17 insertions, 13 deletions
diff --git a/accel-pptpd/ctrl/CMakeLists.txt b/accel-pptpd/ctrl/CMakeLists.txt
index 6b37bc4..1ba3b2a 100644
--- a/accel-pptpd/ctrl/CMakeLists.txt
+++ b/accel-pptpd/ctrl/CMakeLists.txt
@@ -1,3 +1,7 @@
ADD_SUBDIRECTORY(pptp)
ADD_SUBDIRECTORY(pppoe)
-ADD_SUBDIRECTORY(l2tp)
+
+IF (L2TP)
+ ADD_SUBDIRECTORY(l2tp)
+ENDIF (L2TP)
+
diff --git a/accel-pptpd/ctrl/l2tp/CMakeLists.txt b/accel-pptpd/ctrl/l2tp/CMakeLists.txt
index edff55d..c9b483d 100644
--- a/accel-pptpd/ctrl/l2tp/CMakeLists.txt
+++ b/accel-pptpd/ctrl/l2tp/CMakeLists.txt
@@ -8,6 +8,6 @@ ADD_LIBRARY(l2tp SHARED
packet.c
netlink.c
)
-TARGET_LINK_LIBRARIES(l2tp nl)
+TARGET_LINK_LIBRARIES(l2tp nl-genl)
INSTALL(TARGETS l2tp LIBRARY DESTINATION usr/lib/accel-pptp)
diff --git a/accel-pptpd/ctrl/l2tp/netlink.c b/accel-pptpd/ctrl/l2tp/netlink.c
index 0cc5b34..7c8c79a 100644
--- a/accel-pptpd/ctrl/l2tp/netlink.c
+++ b/accel-pptpd/ctrl/l2tp/netlink.c
@@ -9,10 +9,10 @@ static int family;
void l2tp_nl_delete_tunnel(int tid)
{
- struct nl_handle *nl_sock;
+ struct nl_sock *nl_sock;
struct nl_msg *msg;
- nl_sock = nl_handle_alloc();
+ nl_sock = nl_socket_alloc();
msg = nlmsg_alloc();
genl_connect(nl_sock);
@@ -25,15 +25,15 @@ void l2tp_nl_delete_tunnel(int tid)
nlmsg_free(msg);
nl_close(nl_sock);
- nl_handle_destroy(nl_sock);
+ nl_socket_free(nl_sock);
}
void l2tp_nl_create_tunnel(int fd, int tid, int peer_tid)
{
- struct nl_handle *nl_sock;
+ struct nl_sock *nl_sock;
struct nl_msg *msg;
- nl_sock = nl_handle_alloc();
+ nl_sock = nl_socket_alloc();
msg = nlmsg_alloc();
genl_connect(nl_sock);
@@ -51,15 +51,15 @@ void l2tp_nl_create_tunnel(int fd, int tid, int peer_tid)
nlmsg_free(msg);
nl_close(nl_sock);
- nl_handle_destroy(nl_sock);
+ nl_socket_free(nl_sock);
}
void l2tp_nl_create_session(int tid, int sid, int peer_sid)
{
- struct nl_handle *nl_sock;
+ struct nl_sock *nl_sock;
struct nl_msg *msg;
- nl_sock = nl_handle_alloc();
+ nl_sock = nl_socket_alloc();
msg = nlmsg_alloc();
genl_connect(nl_sock);
@@ -77,18 +77,18 @@ void l2tp_nl_create_session(int tid, int sid, int peer_sid)
nlmsg_free(msg);
nl_close(nl_sock);
- nl_handle_destroy(nl_sock);
+ nl_socket_free(nl_sock);
}
static void __init init(void)
{
- struct nl_handle *nl_sock = nl_handle_alloc();
+ struct nl_sock *nl_sock = nl_socket_alloc();
genl_connect(nl_sock);
family = genl_ctrl_resolve(nl_sock, L2TP_GENL_NAME);
nl_close(nl_sock);
- nl_handle_destroy(nl_sock);
+ nl_socket_free(nl_sock);
}