Re: [PATCH] removed TODO, p0f v3 doesn't need that extra info

[email protected] (Robert Spier)
Newsgroups perl.qpsmtpd
Message-ID <CAAroffcYx5ft+ApogGV37wrDDdXyXOfX-LCf01pK-PXUFCxZGQ@mail.gmail.com>
Applied.

On Sun, May 6, 2012 at 1:56 PM, Matt Simerson <[email protected]> wrote:

>
> removed TODO, p0f v3 doesn't need that extra info
>
> removed some stray EOL chars
>
> ---
> lib/Qpsmtpd/TcpServer.pm |   16 ++++++----------
> 1 file changed, 6 insertions(+), 10 deletions(-)
>
> diff --git a/lib/Qpsmtpd/TcpServer.pm b/lib/Qpsmtpd/TcpServer.pm
> index de3504f..7215090 100644
> --- a/lib/Qpsmtpd/TcpServer.pm
> +++ b/lib/Qpsmtpd/TcpServer.pm
> @@ -25,7 +25,7 @@ sub has_ipv6 {
>    return $has_ipv6;
> }
>
> -my $first_0;
> +my $first_0;
>
> sub start_connection {
>    my $self = shift;
> @@ -46,25 +46,21 @@ sub start_connection {
>        $local_port  = $ENV{TCPLOCALPORT};
>        $local_host  = $ENV{TCPLOCALHOST};
>    } else {
> -       # Started from inetd or similar.
> +       # Started from inetd or similar.
>        # get info on the remote host from the socket.
>        # ignore ident/tap/...
> -       my $hersockaddr    = getpeername(STDIN)
> +       my $hersockaddr    = getpeername(STDIN)
>            or die "getpeername failed: $0 must be called from tcpserver,
> (x)inetd or a similar program which passes a socket to stdin";
>        my ($port, $iaddr) = sockaddr_in($hersockaddr);
>        $remote_ip     = inet_ntoa($iaddr);
>        $remote_host    = gethostbyaddr($iaddr, AF_INET) || "[$remote_ip]";
>        $remote_info    = $remote_host;
> -### TODO
> -# set $remote_port, $local_ip, and $local_port. Those values are
> -# required for the p0f plugin to function.
> -### /TODO
>    }
>    $self->log(LOGNOTICE, "Connection from $remote_info [$remote_ip]");
>
>    # if the local dns resolver doesn't filter it out we might get
>    # ansi escape characters that could make a ps axw do "funny"
> -    # things. So to be safe, cut them out.
> +    # things. So to be safe, cut them out.
>    $remote_host =~ tr/a-zA-Z\.\-0-9\[\]//cd;
>
>    $first_0 = $0 unless $first_0;
> @@ -169,7 +165,7 @@ sub tcpenv {
>
>  my $TCPLOCALIP  = $nto_laddr;
>  my $TCPREMOTEIP = $nto_iaddr;
> -
> +
>  if ($no_rdns) {
>    return ($TCPLOCALIP, $TCPREMOTEIP, $TCPREMOTEIP ? "[$ENV{TCPREMOTEIP}]"
> : "[noip!]");
>  }
> @@ -191,7 +187,7 @@ sub check_socket() {
>  my $self = shift;
>
>  return 1 if ( $self->{__client_socket}->connected );
> -
> +
>  return 0;
> }
>
> --
> 1.7.9.6
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.