summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKozlov Dmitry <dima@server>2009-09-25 10:52:07 +0400
committerKozlov Dmitry <dima@server>2009-09-25 10:52:07 +0400
commit69c0f151027d7a8fb872394e7c1062d9e402b5f4 (patch)
tree7122d800224f3e2a6a64a0bcc95c16b4b7776359
parent6fac2c05c6ad0ea9684ad8be38ae2f12687a4df2 (diff)
downloadaccel-ppp-xebd-69c0f151027d7a8fb872394e7c1062d9e402b5f4.tar.gz
accel-ppp-xebd-69c0f151027d7a8fb872394e7c1062d9e402b5f4.zip
accel-pptp 0.8.4
* supports 2.6.31 kernel * included 430-persist.patch (theMIROn)
-rw-r--r--kernel/driver/pptp.c18
-rwxr-xr-xpppd_plugin/configure2
-rw-r--r--pppd_plugin/configure.in2
-rw-r--r--pppd_plugin/src/pptp.c32
-rw-r--r--pppd_plugin/src/pptp_callmgr.c14
-rwxr-xr-xpptpd-1.3.3/configure2
-rw-r--r--pptpd-1.3.3/configure.in2
7 files changed, 50 insertions, 22 deletions
diff --git a/kernel/driver/pptp.c b/kernel/driver/pptp.c
index e76fea6..e968aea 100644
--- a/kernel/driver/pptp.c
+++ b/kernel/driver/pptp.c
@@ -50,7 +50,7 @@
#define DEBUG
-#define PPTP_DRIVER_VERSION "0.8.3"
+#define PPTP_DRIVER_VERSION "0.8.4"
MODULE_DESCRIPTION("Point-to-Point Tunneling Protocol for Linux");
MODULE_AUTHOR("Kozlov D. (xeb@mail.ru)");
@@ -430,7 +430,11 @@ static int pptp_xmit(struct ppp_channel *chan, struct sk_buff *skb)
* Push down and install the IP header.
*/
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31)
+ skb_reset_transport_header(skb);
+ skb_push(skb, sizeof(*iph));
+ skb_reset_network_header(skb);
+ #elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
skb->transport_header = skb->network_header;
skb_push(skb, sizeof(*iph));
skb_reset_network_header(skb);
@@ -463,8 +467,13 @@ static int pptp_xmit(struct ppp_channel *chan, struct sk_buff *skb)
#endif
iph->tot_len = htons(skb->len);
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31)
+ skb_dst_drop(skb);
+ skb_dst_set(skb,&rt->u.dst);
+ #else
dst_release(skb->dst);
skb->dst = &rt->u.dst;
+ #endif
nf_reset(skb);
@@ -630,8 +639,13 @@ static int pptp_rcv(struct sk_buff *skb)
if ((po=lookup_chan(htons(header->call_id),iph->saddr))) {
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31)
+ skb_dst_drop(skb);
+ skb_dst_set(skb,NULL);
+ #else
dst_release(skb->dst);
skb->dst = NULL;
+ #endif
nf_reset(skb);
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,0)
sk=sk_pppox(po);
diff --git a/pppd_plugin/configure b/pppd_plugin/configure
index 4ba196c..3fecbf9 100755
--- a/pppd_plugin/configure
+++ b/pppd_plugin/configure
@@ -2236,7 +2236,7 @@ fi
# Define the identity of the package.
PACKAGE=pptp
- VERSION=0.8.3
+ VERSION=0.8.4
cat >>confdefs.h <<_ACEOF
diff --git a/pppd_plugin/configure.in b/pppd_plugin/configure.in
index 28807f9..6e0e074 100644
--- a/pppd_plugin/configure.in
+++ b/pppd_plugin/configure.in
@@ -1,7 +1,7 @@
AC_INIT(configure.in)
AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE(pptp,0.8.3)
+AM_INIT_AUTOMAKE(pptp,0.8.4)
AC_LANG_C
AC_PROG_CC
diff --git a/pppd_plugin/src/pptp.c b/pppd_plugin/src/pptp.c
index 79bb1d1..4df9188 100644
--- a/pppd_plugin/src/pptp.c
+++ b/pppd_plugin/src/pptp.c
@@ -121,14 +121,14 @@ static int pptp_start_server(void)
}
static int pptp_start_client(void)
{
- int len;
+ socklen_t len;
struct sockaddr_pppox src_addr,dst_addr;
struct hostent *hostinfo;
hostinfo=gethostbyname(pptp_server);
if (!hostinfo)
{
- fatal("PPTP: Unknown host %s\n", pptp_server);
+ error("PPTP: Unknown host %s\n", pptp_server);
return -1;
}
dst_addr.sa_addr.pptp.sin_addr=*(struct in_addr*)hostinfo->h_addr;
@@ -142,7 +142,8 @@ static int pptp_start_client(void)
sock=socket(AF_INET,SOCK_DGRAM,0);
if (connect(sock,(struct sockaddr*)&addr,sizeof(addr)))
{
- fatal("PPTP: connect failed (%s)\n",strerror(errno));
+ close(sock);
+ error("PPTP: connect failed (%s)\n",strerror(errno));
return -1;
}
getsockname(sock,(struct sockaddr*)&addr,&len);
@@ -165,14 +166,15 @@ static int pptp_start_client(void)
pptp_fd=socket(AF_PPPOX,SOCK_STREAM,PX_PROTO_PPTP);
if (pptp_fd<0)
{
- fatal("PPTP: failed to create PPTP socket (%s)\n",strerror(errno));
+ error("PPTP: failed to create PPTP socket (%s)\n",strerror(errno));
return -1;
}
if (setsockopt(pptp_fd,0,PPTP_SO_TIMEOUT,&pptp_timeout,sizeof(pptp_timeout)))
warn("PPTP: failed to setsockopt PPTP_SO_TIMEOUT (%s)\n",strerror(errno));
if (bind(pptp_fd,(struct sockaddr*)&src_addr,sizeof(src_addr)))
{
- fatal("PPTP: failed to bind PPTP socket (%s)\n",strerror(errno));
+ close(pptp_fd);
+ error("PPTP: failed to bind PPTP socket (%s)\n",strerror(errno));
return -1;
}
len=sizeof(src_addr);
@@ -184,12 +186,19 @@ static int pptp_start_client(void)
* Open connection to call manager (Launch call manager if necessary.)
*/
callmgr_sock = open_callmgr(src_addr.sa_addr.pptp.call_id,dst_addr.sa_addr.pptp.sin_addr, pptp_phone,50);
+ if (callmgr_sock<0)
+ {
+ close(pptp_fd);
+ return -1;
+ }
/* Exchange PIDs, get call ID */
} while (get_call_id(callmgr_sock, getpid(), getpid(), &dst_addr.sa_addr.pptp.call_id) < 0);
if (connect(pptp_fd,(struct sockaddr*)&dst_addr,sizeof(dst_addr)))
{
- fatal("PPTP: failed to connect PPTP socket (%s)\n",strerror(errno));
+ close(callmgr_sock);
+ close(pptp_fd);
+ error("PPTP: failed to connect PPTP socket (%s)\n",strerror(errno));
return -1;
}
@@ -211,6 +220,7 @@ static int pptp_connect(void)
static void pptp_disconnect(void)
{
+ if (pptp_server) close(callmgr_sock);
close(pptp_fd);
}
@@ -245,7 +255,7 @@ static int open_callmgr(int call_id,struct in_addr inetaddr, char *phonenr,int w
case 0: /* child */
{
close (fd);
- //close(pptp_fd);
+ close(pptp_fd);
/* close the pty and gre in the call manager */
// close(pty_fd);
//close(gre_fd);
@@ -254,7 +264,11 @@ static int open_callmgr(int call_id,struct in_addr inetaddr, char *phonenr,int w
default: /* parent */
waitpid(pid, &status, 0);
if (status!= 0)
- fatal("Call manager exited with error %d", status);
+ {
+ close(fd);
+ error("Call manager exited with error %d", status);
+ return -1;
+ }
break;
}
sleep(1);
@@ -262,7 +276,7 @@ static int open_callmgr(int call_id,struct in_addr inetaddr, char *phonenr,int w
else return fd;
}
close(fd);
- fatal("Could not launch call manager after %d tries.", i);
+ error("Could not launch call manager after %d tries.", i);
return -1; /* make gcc happy */
}
diff --git a/pppd_plugin/src/pptp_callmgr.c b/pppd_plugin/src/pptp_callmgr.c
index 988e717..20bb736 100644
--- a/pppd_plugin/src/pptp_callmgr.c
+++ b/pppd_plugin/src/pptp_callmgr.c
@@ -84,8 +84,8 @@ void call_callback(PPTP_CONN *conn, PPTP_CALL *call, enum call_state state)
vector_remove(conninfo->call_list, lci->unix_sock);
close(lci->unix_sock);
FD_CLR(lci->unix_sock, conninfo->call_set);
- if(lci->pid[0] > 1) kill(lci->pid[0], SIGTERM);
- if(lci->pid[1] > 1) kill(lci->pid[1], SIGTERM);
+ //if(lci->pid[0] > 1) kill(lci->pid[0], SIGTERM);
+ //if(lci->pid[1] > 1) kill(lci->pid[1], SIGTERM);
}
break;
default:
@@ -243,8 +243,8 @@ skip_accept: /* Step 5c: Handle socket close */
struct local_callinfo *lci =
pptp_call_closure_get(conn, call);
log("Closing connection (unhandled)");
- if(lci->pid[0] > 1) kill(lci->pid[0], SIGTERM);
- if(lci->pid[1] > 1) kill(lci->pid[1], SIGTERM);
+ //if(lci->pid[0] > 1) kill(lci->pid[0], SIGTERM);
+ //if(lci->pid[1] > 1) kill(lci->pid[1], SIGTERM);
free(lci);
/* soft shutdown. Callback will do hard shutdown later */
pptp_call_close(conn, call);
@@ -265,11 +265,11 @@ shutdown:
/* kill all open calls */
for (i = 0; i < vector_size(call_list); i++) {
PPTP_CALL *call = vector_get_Nth(call_list, i);
- struct local_callinfo *lci = pptp_call_closure_get(conn, call);
+ //struct local_callinfo *lci = pptp_call_closure_get(conn, call);
log("Closing connection (shutdown)");
pptp_call_close(conn, call);
- if(lci->pid[0] > 1) kill(lci->pid[0], SIGTERM);
- if(lci->pid[1] > 1) kill(lci->pid[1], SIGTERM);
+ //if(lci->pid[0] > 1) kill(lci->pid[0], SIGTERM);
+ //if(lci->pid[1] > 1) kill(lci->pid[1], SIGTERM);
}
/* attempt to dispatch these messages */
FD_ZERO(&read_set);
diff --git a/pptpd-1.3.3/configure b/pptpd-1.3.3/configure
index 66ed7af..c8c463e 100755
--- a/pptpd-1.3.3/configure
+++ b/pptpd-1.3.3/configure
@@ -2043,7 +2043,7 @@ fi
# Define the identity of the package.
PACKAGE=pptpd
- VERSION=0.8.3
+ VERSION=0.8.4
cat >>confdefs.h <<_ACEOF
diff --git a/pptpd-1.3.3/configure.in b/pptpd-1.3.3/configure.in
index ad4d468..185963b 100644
--- a/pptpd-1.3.3/configure.in
+++ b/pptpd-1.3.3/configure.in
@@ -1,7 +1,7 @@
AC_INIT(configure.in)
AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE(pptpd,0.8.3)
+AM_INIT_AUTOMAKE(pptpd,0.8.4)
AC_DEFINE(BCRELAY,[],"Enable Broadcast Relay")
AC_DEFINE(PPPD_VERSION,[],"PPPD version")