Merge pull request #182 from rhansen/fix-use-ip

Fix `use=ip` when `ip` is set to an IPv4 address
This commit is contained in:
Richard Hansen 2020-06-17 12:16:35 -04:00 committed by GitHub
commit aeba95aef4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View file

@ -11,6 +11,8 @@ repository history](https://github.com/ddclient/ddclient/commits/master).
### Bug fixes ### Bug fixes
* Fixed a regression introduced in v3.9.0 that caused
`use=ip,ip=<ipv4-address>` to fail.
* "true" is now accepted as a boolean value. * "true" is now accepted as a boolean value.
### Compatibility and dependency changes ### Compatibility and dependency changes

View file

@ -2287,7 +2287,9 @@ sub get_ip {
$skip =~ s/ /\\s/is; $skip =~ s/ /\\s/is;
$reply =~ s/^.*?${skip}//is; $reply =~ s/^.*?${skip}//is;
} }
if ($reply =~ /^.*?\b(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})\b.*/is) { if (defined($ip)) {
# no need to parse $reply
} elsif ($reply =~ /^.*?\b(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})\b.*/is) {
$ip = $1; $ip = $1;
$ip = un_zero_pad($ip); $ip = un_zero_pad($ip);
$ip = filter_local($ip) if opt('fw-banlocal', $h); $ip = filter_local($ip) if opt('fw-banlocal', $h);