You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by he...@apache.org on 2019/06/23 09:26:37 UTC
svn commit: r1861908 - in /spamassassin: branches/3.4/sa-update.raw
trunk/sa-update.raw
Author: hege
Date: Sun Jun 23 09:26:37 2019
New Revision: 1861908
URL: http://svn.apache.org/viewvc?rev=1861908&view=rev
Log:
Few trivial ipv4/ipv6 fixes, handle forcing better
Modified:
spamassassin/branches/3.4/sa-update.raw
spamassassin/trunk/sa-update.raw
Modified: spamassassin/branches/3.4/sa-update.raw
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/sa-update.raw?rev=1861908&r1=1861907&r2=1861908&view=diff
==============================================================================
--- spamassassin/branches/3.4/sa-update.raw (original)
+++ spamassassin/branches/3.4/sa-update.raw Sun Jun 23 09:26:37 2019
@@ -91,7 +91,7 @@ use Archive::Tar 1.23;
use IO::Zlib 1.04;
use Mail::SpamAssassin::Logger qw(:DEFAULT info log_message);
-our ($have_lwp, $io_socket_module_name, $have_inet4, $have_inet6, $have_sha256, $have_sha512);
+our ($have_lwp, $io_socket_module_name, $have_inet4, $use_inet4, $have_inet6, $use_inet6, $have_sha256, $have_sha512);
BEGIN {
# Deal with optional modules
@@ -226,6 +226,9 @@ if ( $opt{'allowplugins'} && !$opt{'real
"- specify --reallyallowplugins to allow activating plugins\n";
}
+$use_inet4 = $have_inet4 && ( !$opt{'force_pf'} || $opt{'force_pf'} eq 'inet' );
+$use_inet6 = $have_inet6 && ( !$opt{'force_pf'} || $opt{'force_pf'} eq 'inet6' );
+
if ( $opt{'force_pf'} && $opt{'force_pf'} eq 'inet' && !$have_inet4 ) {
warn "Option -4 specified but support for the ".
"INET protocol family is not available.\n";
@@ -772,11 +775,12 @@ foreach my $channel (@channels) {
if (!check_mirror_af($mirror)) {
my @my_af;
- push(@my_af, "IPv4") if $have_inet4;
- push(@my_af, "IPv6") if $have_inet6;
+ push(@my_af, "IPv4") if $use_inet4;
+ push(@my_af, "IPv6") if $use_inet6;
push(@my_af, "no IP service") if !@my_af;
dbg("reject mirror %s: no common address family (%s)",
$mirror, join(" ", @my_af));
+ sleep(1);
next;
}
@@ -1735,11 +1739,11 @@ sub check_mirror_af {
return 1 if $scheme eq "http" && $http_proxy;
return 1 if $scheme eq "https" && $https_proxy;
# No DNS check needed for IPv4 or IPv6 address literal
- return 1 if $mirror =~ m{^\d+\.\d+\.\d+\.\d+(?:[:/]|$)};
- return 1 if $mirror =~ m{^\[};
+ return 1 if $use_inet4 && $mirror =~ m{^\d+\.\d+\.\d+\.\d+(?:[:/]|$)};
+ return 1 if $use_inet6 && $mirror =~ m{^\[};
$mirror =~ s{[:/].*}{}s; # strip all starting from :port or /path
- return 1 if $have_inet4 && do_dns_query($mirror, "A");
- return 1 if $have_inet6 && do_dns_query($mirror, "AAAA");
+ return 1 if $use_inet4 && do_dns_query($mirror, "A");
+ return 1 if $use_inet6 && do_dns_query($mirror, "AAAA");
return 0;
}
Modified: spamassassin/trunk/sa-update.raw
URL: http://svn.apache.org/viewvc/spamassassin/trunk/sa-update.raw?rev=1861908&r1=1861907&r2=1861908&view=diff
==============================================================================
--- spamassassin/trunk/sa-update.raw (original)
+++ spamassassin/trunk/sa-update.raw Sun Jun 23 09:26:37 2019
@@ -91,7 +91,7 @@ use Archive::Tar 1.23;
use IO::Zlib 1.04;
use Mail::SpamAssassin::Logger qw(:DEFAULT info log_message);
-our ($have_lwp, $io_socket_module_name, $have_inet4, $have_inet6, $have_sha256, $have_sha512);
+our ($have_lwp, $io_socket_module_name, $have_inet4, $use_inet4, $have_inet6, $use_inet6, $have_sha256, $have_sha512);
BEGIN {
# Deal with optional modules
@@ -226,6 +226,9 @@ if ( $opt{'allowplugins'} && !$opt{'real
"- specify --reallyallowplugins to allow activating plugins\n";
}
+$use_inet4 = $have_inet4 && ( !$opt{'force_pf'} || $opt{'force_pf'} eq 'inet' );
+$use_inet6 = $have_inet6 && ( !$opt{'force_pf'} || $opt{'force_pf'} eq 'inet6' );
+
if ( $opt{'force_pf'} && $opt{'force_pf'} eq 'inet' && !$have_inet4 ) {
warn "Option -4 specified but support for the ".
"INET protocol family is not available.\n";
@@ -772,11 +775,12 @@ foreach my $channel (@channels) {
if (!check_mirror_af($mirror)) {
my @my_af;
- push(@my_af, "IPv4") if $have_inet4;
- push(@my_af, "IPv6") if $have_inet6;
+ push(@my_af, "IPv4") if $use_inet4;
+ push(@my_af, "IPv6") if $use_inet6;
push(@my_af, "no IP service") if !@my_af;
dbg("reject mirror %s: no common address family (%s)",
$mirror, join(" ", @my_af));
+ sleep(1);
next;
}
@@ -1735,11 +1739,11 @@ sub check_mirror_af {
return 1 if $scheme eq "http" && $http_proxy;
return 1 if $scheme eq "https" && $https_proxy;
# No DNS check needed for IPv4 or IPv6 address literal
- return 1 if $mirror =~ m{^\d+\.\d+\.\d+\.\d+(?:[:/]|$)};
- return 1 if $mirror =~ m{^\[};
+ return 1 if $use_inet4 && $mirror =~ m{^\d+\.\d+\.\d+\.\d+(?:[:/]|$)};
+ return 1 if $use_inet6 && $mirror =~ m{^\[};
$mirror =~ s{[:/].*}{}s; # strip all starting from :port or /path
- return 1 if $have_inet4 && do_dns_query($mirror, "A");
- return 1 if $have_inet6 && do_dns_query($mirror, "AAAA");
+ return 1 if $use_inet4 && do_dns_query($mirror, "A");
+ return 1 if $use_inet6 && do_dns_query($mirror, "AAAA");
return 0;
}