diff --git a/ddclient b/ddclient index 524a00b..9267053 100755 --- a/ddclient +++ b/ddclient @@ -2406,11 +2406,10 @@ sub get_ipv6 { } elsif ($usev6 eq 'if') { $skip = opt('if-skip', $h) || ''; - $reply = `ip -6 addr list dev $arg | grep "scope.global" 2> /dev/null`; - if ($reply =~ /.*? ([0-9:][^\/]*)/i) { + $reply = `ip -6 -o addr show dev $arg scope global 2>/dev/null`; + if ($reply =~ /^.*? ([a-f0-9]{1,4}:[a-f0-9:]+:[a-f0-9]{1,4})\/.*/is) { $reply = $1; - } - else { + } else { $reply = '' } } elsif ($usev6 eq 'cmd') { @@ -2450,7 +2449,11 @@ sub get_ipv6 { } # Extract IPv6 address from the text - $ipv6 = $& if ($reply =~ /(?i)(?