mirror of
https://github.com/isc-projects/bind9.git
synced 2026-05-27 20:25:55 -04:00
Remove workarounds for dnspython < 2.7.0
dnspython 2.7.0 is now required to run the BIND 9 system test suite. Drop the workarounds for older dnspython versions as they are now redundant.
This commit is contained in:
parent
de42425bbd
commit
c9ceb191e8
2 changed files with 4 additions and 12 deletions
|
|
@ -44,12 +44,8 @@ def _add_cookie(qctx: QueryContext) -> None:
|
|||
for o in qctx.query.options:
|
||||
if o.otype == dns.edns.OptionType.COOKIE:
|
||||
cookie = o
|
||||
try:
|
||||
if len(cookie.server) == 0:
|
||||
cookie.server = cookie.client
|
||||
except AttributeError: # dnspython<2.7.0 compat
|
||||
if len(o.data) == 8:
|
||||
cookie.data *= 2
|
||||
if len(cookie.server) == 0:
|
||||
cookie.server = cookie.client
|
||||
|
||||
qctx.response.use_edns(options=[cookie])
|
||||
return
|
||||
|
|
|
|||
|
|
@ -32,12 +32,8 @@ def _get_cookie(qctx: QueryContext):
|
|||
for o in qctx.query.options:
|
||||
if o.otype == dns.edns.OptionType.COOKIE:
|
||||
cookie = o
|
||||
try:
|
||||
if len(cookie.server) == 0:
|
||||
cookie.server = b"\x11\x22\x33\x44\x55\x66\x77\x88"
|
||||
except AttributeError: # dnspython<2.7.0 compat
|
||||
if len(o.data) == 8:
|
||||
cookie.data *= 2
|
||||
if len(cookie.server) == 0:
|
||||
cookie.server = b"\x11\x22\x33\x44\x55\x66\x77\x88"
|
||||
|
||||
return cookie
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue