Testsuite: avoid picking 0.0.0.0 as the HOSTIPV4; permit 10.0/8 apart from 10.250...
[exim.git] / test / runtest
index 62b24290376f3964a189ebf973841bd77fe7a822..27cbeaa006894efb065b626c9af3be662198719a 100755 (executable)
@@ -3318,6 +3318,7 @@ else
 
 # Find this host's IP addresses - there may be many, of course, but we keep
 # one of each type (IPv4 and IPv6).
+#XXX it would be good to avoid non-UP interfaces
 
 open(IFCONFIG, '-|', (grep { -x "$_/ip" } split /:/, $ENV{PATH}) ? 'ip address' : 'ifconfig -a')
   or die "** Cannot run 'ip address' or 'ifconfig -a'\n";
@@ -3325,7 +3326,8 @@ while (not ($parm_ipv4 and $parm_ipv6) and defined($_ = <IFCONFIG>))
   {
   if (not $parm_ipv4 and /^\s*inet(?:\saddr)?:?\s?(\d+\.\d+\.\d+\.\d+)(?:\/\d+)?\s/i)
     {
-    next if $1 =~ /^(?:127|10)\./;
+    next if $1 =~ /^(?:127|10\.250)\./;
+    next if $1 eq '0.0.0.0';
     $parm_ipv4 = $1;
     }