Skip to content

Commit

Permalink
strip prefix-length / netmask if present, fixes nsupdate-info#470
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasWaldmann committed Nov 8, 2021
1 parent f6a6eec commit 1792c69
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/nsupdate/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,10 @@ def _update_or_delete(host, ipaddr, secure=False, logger=None, _delete=False):
# https://github.com/rthalley/dnspython/issues/41
# TODO: reproduce and submit traceback to issue 41
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'))
rdtype = 'A' if kind == 'ipv4' else 'AAAA'
IPNetwork(ipaddr) # raise AddrFormatError here if there is an issue with ipaddr, see #394
Expand Down

0 comments on commit 1792c69

Please sign in to comment.