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

[discovery-proxy] remove assert checks on query name parse errors #2208

Merged
merged 1 commit into from
Feb 29, 2024

Conversation

abtink
Copy link
Member

@abtink abtink commented Feb 29, 2024

Remove the assert checks on query name parse errors and instead skip over such entries. Query names are external input (received as DNS query message from other devices) and discovery proxy code should not assume that external input will follow the proper query name format.


@abtink abtink changed the title [discovery-proxy] Remove assert checks on query name parse errors [discovery-proxy] remove assert checks on query name parse errors Feb 29, 2024
@abtink abtink force-pushed the disproxy/remove-unnecarsy-assert branch 2 times, most recently from 1e0cd5b to 9f87be2 Compare February 29, 2024 18:50
Copy link
Member

@wgtdkp wgtdkp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍


if (splitError != OTBR_ERROR_NONE)
{
continue;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: it may worth a debug or info log for triage

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be a good idea but may also extra logs (if there are many queries with invalid format).

I leave it to you or other folks to add logs in future PRs.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue is that if the client is doing a resolve, but we get a service published at the time, the path of:

       case OT_DNSSD_QUERY_TYPE_BROWSE:
            splitError = SplitFullServiceName(queryName, serviceName, domain);

will get hit, but that will (and should) always fail since the request was for an instance, not a service.

Copy link
Member

@suveshpratapa suveshpratapa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link

codecov bot commented Feb 29, 2024

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 39.52%. Comparing base (2b41187) to head (1d43f50).
Report is 597 commits behind head on main.

Files Patch % Lines
src/sdp_proxy/discovery_proxy.cpp 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #2208       +/-   ##
===========================================
- Coverage   55.77%   39.52%   -16.26%     
===========================================
  Files          87       88        +1     
  Lines        6890     9705     +2815     
  Branches        0      712      +712     
===========================================
- Hits         3843     3836        -7     
- Misses       3047     5675     +2628     
- Partials        0      194      +194     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Remove the `assert` checks on query name parse errors and instead skip
over such entries. Query names are external input (received as DNS
query message from other devices) and discovery proxy code should not
assume that external input will follow the proper query name format.
@abtink abtink force-pushed the disproxy/remove-unnecarsy-assert branch from 9f87be2 to 1d43f50 Compare February 29, 2024 20:17
@jwhui jwhui merged commit a3adddb into openthread:main Feb 29, 2024
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

otbr intermittently crashes when a thread sed tries to do a srv & txt query
5 participants