mirror of
https://github.com/netbirdio/plugins.git
synced 2026-05-22 18:44:07 -07:00
dns/ddclient: Fix IPv6 address parsing from external service (#3217)
When using external services to determine the public IPv6 address of an interface, the bounds are too limited for short (but valid) IPv6 addresses. Reducing the necessary amount of colon characters in the resolved IPv6 address for the `checkip` script to accept them fixes this issue.
This commit is contained in:
@@ -23,6 +23,7 @@ Plugin Changelog
|
||||
* Add sitelutions support (contributed by Luca Schoeneberg)
|
||||
* Add woima support (contributed by Luca Schoeneberg)
|
||||
* Add Yandex support (contributed by Luca Schoeneberg)
|
||||
* Fix parsing short IPv6 addresses from external service (contributed by Patrick Grupp)
|
||||
|
||||
1.9
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ def extract_address(txt):
|
||||
"""
|
||||
for regexp in [r'[^a-fA-F0-9\:]', r'[^F0-9\.]']:
|
||||
for line in re.sub(regexp, ' ', txt).split():
|
||||
if line.count('.') == 3 or line.count(':') > 4:
|
||||
if line.count('.') == 3 or line.count(':') >= 2:
|
||||
try:
|
||||
ipaddress.ip_address(line)
|
||||
return line
|
||||
|
||||
Reference in New Issue
Block a user