Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix AXFR-style IXFR with multiple messages. #1151

Merged
merged 1 commit into from
Oct 18, 2024

Conversation

bwelling
Copy link
Collaborator

The inbound xfr code is conflating the expected rdtype in responses with the incremental/replacement response style. This causes a problem when an AXFR-style IXFR response spans multiple messages, as resetting the style to AXFR (replacement) also changed the expected type in the question section of future responses to AXFR.

This change separates out the style from the expected rdtype.

This should fix #1150.

The inbound xfr code is conflating the expected rdtype in responses with
the incremental/replacement response style.  This causes a problem when
an AXFR-style IXFR response spans multiple messages, as resetting the
style to AXFR (replacement) also changed the expected type in the
question section of future responses to AXFR.

This change separates out the style from the expected rdtype.
@schanzen
Copy link

Oh I see. Yes my analysis of the server response was a bit superficial.

I have another question then regarding this behavior.
As a caller, I kind of need to know if I get an AXFR response and I need to "blank slate" reset the zone information or this is an incremental update that adds/deletes the records. Is there any way to check which kind of transfer is being done?

@schanzen
Copy link

Another note:

if you change the above code to do an AXFR (serial=None) I also get an exception:

Traceback (most recent call last):
  File "/home/schanzen/dev/ascension/test.py", line 7, in <module>
    dns.query.inbound_xfr("195.43.86.175", zone, txn)
  File "/home/schanzen/dev/ascension/.venv/lib64/python3.12/site-packages/dns/query.py", line 1665, in inbound_xfr
    for _ in _inbound_xfr(txn_manager, s, query, serial, timeout, expiration):
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/schanzen/dev/ascension/.venv/lib64/python3.12/site-packages/dns/query.py", line 1470, in _inbound_xfr
    done = inbound.process_message(r)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/schanzen/dev/ascension/.venv/lib64/python3.12/site-packages/dns/xfr.py", line 207, in process_message
    raise dns.exception.FormError("unexpected origin SOA in AXFR")
dns.exception.FormError: unexpected origin SOA in AXFR

@rthalley rthalley merged commit 51f1583 into rthalley:main Oct 18, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issues with IXFR requests against ee.
3 participants