# Get the original destination of the connection # that was redirected to our socket my $p= getsockopt $client, $SOL_IP, $SO_ORIGINAL_DST; $orig_destaddr=inet_ntoa(substr($p,4,4)); $orig_destport=unpack('n',substr($p,2,2));