Skip to content

fix: always answer QU questions when the exact same packet is received from different sources in sequence#1178

Merged
bdraco merged 15 commits into
masterfrom
ignore_only_if_no_qu
Jun 4, 2023
Merged

fix: always answer QU questions when the exact same packet is received from different sources in sequence#1178
bdraco merged 15 commits into
masterfrom
ignore_only_if_no_qu

Conversation

@bdraco

@bdraco bdraco commented Jun 3, 2023

Copy link
Copy Markdown
Member

If the exact same packet with a QU question is asked from two different sources in a 1s window we end up ignoring the second one as a duplicate. We should still respond in this case because the client wants a unicast response and the question may not be answered by the previous packet since the response may not be multicast.

fix: include NSEC records in initial broadcast when registering a new service

This also revealed that we do not send NSEC records in the initial broadcast. This needed to be fixed in this PR as well for everything to work as expected since all the tests would fail with 2 updates otherwise.

@bdraco bdraco changed the title fix: do not ignore duplicate packets if they contain QU questions fix: only the first request of QU questions with the exact same packet from different sources would be answered Jun 4, 2023
@bdraco bdraco changed the title fix: only the first request of QU questions with the exact same packet from different sources would be answered fix: ensure we always answer QU questions with the exact same packet received from different sources in seqence Jun 4, 2023
@bdraco

bdraco commented Jun 4, 2023

Copy link
Copy Markdown
Member Author

confirmed this fixes the issue.

Lots of tests to update.

verified no performance regression

@bdraco bdraco changed the title fix: ensure we always answer QU questions with the exact same packet received from different sources in seqence fix: always answer QU questions when the exact same packet is received from different sources in sequence Jun 4, 2023
@codecov

codecov Bot commented Jun 4, 2023

Copy link
Copy Markdown

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (bb496a1) 99.81% compared to head (71e36b1) 99.81%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1178   +/-   ##
=======================================
  Coverage   99.81%   99.81%           
=======================================
  Files          22       22           
  Lines        2676     2687   +11     
  Branches      466      471    +5     
=======================================
+ Hits         2671     2682   +11     
  Misses          3        3           
  Partials        2        2           
Impacted Files Coverage Δ
src/zeroconf/__init__.py 100.00% <100.00%> (ø)
src/zeroconf/_core.py 100.00% <100.00%> (ø)
src/zeroconf/_handlers.py 100.00% <100.00%> (ø)
src/zeroconf/_protocol/incoming.py 99.00% <100.00%> (+0.03%) ⬆️
src/zeroconf/_services/info.py 100.00% <100.00%> (ø)
src/zeroconf/_services/registry.py 100.00% <100.00%> (ø)
src/zeroconf/const.py 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@bdraco bdraco marked this pull request as ready for review June 4, 2023 23:25
@bdraco bdraco merged commit 74d7ba1 into master Jun 4, 2023
@bdraco bdraco deleted the ignore_only_if_no_qu branch June 4, 2023 23:26
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.

1 participant