summaryrefslogtreecommitdiff
path: root/security/trans-proxy-tor/files/patch-lazy-day
blob: aeed6c7b22d00f5871af3c30d0b0877f2ee62083 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
--- trans-proxy-tor.orig	Wed Jun 21 03:17:50 2006
+++ trans-proxy-tor	Thu Jun 22 14:53:59 2006
@@ -121,9 +121,21 @@
 
   BEGIN {
     if ($^O =~ /^(?:open|net|free)bsd\z/) {
-      require 'sys/ioctl.ph';
-      require 'netinet/in.ph';
-      require 'net/pfvar.ph';
+
+# These perl headers can be created on FreeBSD as well,
+# but it leads to headaches if the user compiled world
+# and kernel without IPv6 support or has incomplete headers
+# installed.
+#
+# As the port maintainer was too lazy anyway, the values
+# for PF_OUT and IPPROTO_TCP are now hard coded instead.
+# The information how to do that came from tun,
+# the creator of trans-proxy-tor.
+#
+#      require 'sys/ioctl.ph';
+#      require 'netinet/in.ph';
+#      require 'net/pfvar.ph';
+
       *_get_original_destination = \&_get_original_destination_pf;
       if ($^O eq 'openbsd') {
         sysopen $Pf, '/dev/pf', O_RDONLY
@@ -159,9 +171,9 @@
 
     my %pnl = map { $_ => 0 } @pfioc_natlook;
 
-    $pnl{direction} = PF_OUT();
+    $pnl{direction} = 2; #PF_OUT();
     $pnl{af}        = AF_INET;
-    $pnl{proto}     = IPPROTO_TCP();
+    $pnl{proto}     = 6; #IPPROTO_TCP();
 
     @pnl{qw/sport saddr/} = sockaddr_in $self->{client}{sockaddr};
     @pnl{qw/dport daddr/} = sockaddr_in getsockname $self->{client}{handle};