summaryrefslogtreecommitdiff
path: root/accel-pppd/ctrl/pptp/pptp.c
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2013-12-24 10:19:28 +0400
committerDmitry Kozlov <xeb@mail.ru>2013-12-24 10:19:28 +0400
commit4e4b0ad6ab81517fb4bd24ee74331b32111de5e4 (patch)
tree4ea1bcecbc1871f6b5b703d2fce3744269038390 /accel-pppd/ctrl/pptp/pptp.c
parentc4ddc0fe1f402f84b1bb01b9568e2294569d0d15 (diff)
downloadaccel-ppp-4e4b0ad6ab81517fb4bd24ee74331b32111de5e4.tar.gz
accel-ppp-4e4b0ad6ab81517fb4bd24ee74331b32111de5e4.zip
Revert "ppp: don't unconditionaly load pppoe/pptp/l2tp modules, fixes false start warning if they're running already"
This reverts commit c4ddc0fe1f402f84b1bb01b9568e2294569d0d15.
Diffstat (limited to 'accel-pppd/ctrl/pptp/pptp.c')
-rw-r--r--accel-pppd/ctrl/pptp/pptp.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/accel-pppd/ctrl/pptp/pptp.c b/accel-pppd/ctrl/pptp/pptp.c
index 46e980e..31ffd00 100644
--- a/accel-pppd/ctrl/pptp/pptp.c
+++ b/accel-pppd/ctrl/pptp/pptp.c
@@ -771,20 +771,16 @@ static void pptp_init(void)
{
struct sockaddr_in addr;
char *opt;
- int fd;
- fd = socket(AF_PPPOX, SOCK_DGRAM, PX_PROTO_PPTP);
- if (fd >= 0)
- close(fd);
- else if (system("modprobe -q pptp"))
+ if (system("modprobe -q pptp"))
log_warn("failed to load pptp kernel module\n");
serv.hnd.fd = socket(PF_INET, SOCK_STREAM, 0);
- if (serv.hnd.fd < 0) {
- log_emerg("pptp: failed to create server socket: %s\n", strerror(errno));
- return;
- }
-
+ if (serv.hnd.fd < 0) {
+ log_emerg("pptp: failed to create server socket: %s\n", strerror(errno));
+ return;
+ }
+
fcntl(serv.hnd.fd, F_SETFD, fcntl(serv.hnd.fd, F_GETFD) | FD_CLOEXEC);
addr.sin_family = AF_INET;