strip prefix-length / netmask if present, fixes #470
This commit is contained in:
parent
f6a6eeca08
commit
1792c69223
@ -355,6 +355,10 @@ def _update_or_delete(host, ipaddr, secure=False, logger=None, _delete=False):
|
|||||||
# https://github.com/rthalley/dnspython/issues/41
|
# https://github.com/rthalley/dnspython/issues/41
|
||||||
# TODO: reproduce and submit traceback to issue 41
|
# TODO: reproduce and submit traceback to issue 41
|
||||||
ipaddr = str(ipaddr)
|
ipaddr = str(ipaddr)
|
||||||
|
if '/' in ipaddr:
|
||||||
|
# looks like there is a trailing /xx prefix length / netmask - get rid of it.
|
||||||
|
# by doing this we support myip=<ip6lanprefix> of FritzBox.
|
||||||
|
ipaddr = ipaddr.rsplit('/')[0]
|
||||||
kind = check_ip(ipaddr, ('ipv4', 'ipv6'))
|
kind = check_ip(ipaddr, ('ipv4', 'ipv6'))
|
||||||
rdtype = 'A' if kind == 'ipv4' else 'AAAA'
|
rdtype = 'A' if kind == 'ipv4' else 'AAAA'
|
||||||
IPNetwork(ipaddr) # raise AddrFormatError here if there is an issue with ipaddr, see #394
|
IPNetwork(ipaddr) # raise AddrFormatError here if there is an issue with ipaddr, see #394
|
||||||
|
Loading…
x
Reference in New Issue
Block a user