openbsd-ports/net/poptop/patches/patch-pptpd_c
giovanni 43f5f8629c Update to 1.3.4
Disabled plugins support on *bsd (upstream patch)
Remove unnedeed patches
"ok portwise" sthen@
2009-01-21 16:07:15 +00:00

36 lines
968 B
Plaintext

$OpenBSD: patch-pptpd_c,v 1.2 2009/01/21 16:07:15 giovanni Exp $
--- pptpd.c.orig Tue Sep 5 01:17:25 2006
+++ pptpd.c Tue Jun 24 09:45:13 2008
@@ -36,6 +36,11 @@
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
+#ifdef __OpenBSD__
+#include <netinet/ip_gre.h>
+#include <sys/param.h>
+#include <sys/sysctl.h>
+#endif
#include <sys/wait.h>
#include <sys/stat.h>
#include <unistd.h>
@@ -433,6 +438,19 @@ int main(int argc, char **argv)
#endif
/* after we have our final pid... */
log_pid(pid_file);
+
+#ifdef __OpenBSD__
+ {
+ int mib[] = { CTL_NET, PF_INET, IPPROTO_GRE, GRECTL_ALLOW };
+ int gre_allow = 1;
+
+ if (sysctl(mib, 4, NULL, 0, &gre_allow, sizeof(gre_allow)) == -1) {
+ syslog(LOG_ERR, "PPTPD: failed to allow GRE, errno=%d\n",
+ errno);
+ return 1;
+ }
+ }
+#endif
/* manage connections until SIGTERM */
pptp_manager(argc, argv);