Skip to content

Commit

Permalink
Merge pull request nsupdate-info#489 from ThomasWaldmann/strip-prefix…
Browse files Browse the repository at this point in the history
…-length

strip prefix-length / netmask if present, fixes nsupdate-info#470
  • Loading branch information
ThomasWaldmann authored Nov 8, 2021
2 parents f6a6eec + 1792c69 commit 7285eca
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 7285eca

Please sign in to comment.