http://bugzilla.spamassassin.org/show_bug.cgi?id=4412





------- Additional Comments From [EMAIL PROTECTED]  2005-08-17 09:47 -------
The patch passes make test on my system, but I don't understand what is going on
with this part of the patch that removes two lines of code

-  $self->{dest} = sockaddr_in($self->{res}->{port},
-            inet_aton($self->{res}->{nameservers}[0]));

I see that $self->{dest} is used later in sub bgsend in the following snippet:

my $data = $pkt->data;
my $dest = $self->{dest};
$self->connect_sock() if !$self->{sock};
if (!$self->{sock}->send ($pkt->data, 0, $self->{dest})) {
  warn "dns: sendto() failed: $@";
  return;
}

And then $data and $dest are never used, which is a separate issue.

The code in Net::DNS::Resolver::Base.pm version 0.53 in sub send_udp that
computes the equivalent of $self->{dest} here distinguishes between IPv6 and
IPv4 doing something like the following to compute what it names $dst_sockaddr:

In the IPv4 case it looks like
  $dst_sockaddr = sockaddr_in($dstport, inet_aton($ns_address));

In the IPv6 case it looks like
 # we can use getaddrinfo
 no strict 'subs';   # Because of the eval statement in the BEGIN
 # AI_NUMERICHOST is not available at compile time.
 # The AI_NUMERICHOST surpresses lookups.

 my $old_wflag = $^W;      #circumvent perl -w warnings about 'udp'
 $^W = 0;

 my @res = getaddrinfo($ns_address, $dstport, AF_UNSPEC, SOCK_DGRAM,
          0, AI_NUMERICHOST);

 $^W=$old_wflag ;

 use strict 'subs';

 my ($sockfamily, $socktype_tmp,
 $proto_tmp, $dst_sockaddr, $canonname_tmp) = @res;

So do we need equivalent code to compute $self->{dest}? Why were those lines
just removed in the patch if $self->{dest} is later used in sub bgsend?

I don't have time right now to figure out a test case to demonstrate bgsend
breaking with this patch or to figure out why it doesn't break, but this doesn't
look to me like it could be correct.






------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

Reply via email to