--- 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};