-
Notifications
You must be signed in to change notification settings - Fork 167
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
No searching for end-points when responding to mDNS/LLMNR/NBNS #1064
No searching for end-points when responding to mDNS/LLMNR/NBNS #1064
Conversation
…d during the reception of the query instead of searching for one.
…rkBuffer ) which is no longer needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @evpopov
* @param[in] pxNetworkBuffer The Ethernet packet that was received. | ||
* @return An end-point. | ||
*/ | ||
static NetworkEndPoint_t * prvFindEndPointOnNetMask( NetworkBufferDescriptor_t * pxNetworkBuffer ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we already wrote in your issue #1042 I totally agree with this choice. And also I agree that the endpoint receiving a request should be used for the reply as well.
I already tested this PR and it looks good, both IPV4 and IPv6 connections, and for A and AAAA DNS requests.
Please take a look at the PR checks and correct the issues. |
@n9wxu wrote:
To @evpopov, adapted unit tests: FreeRTOS_DNS_Parser_utest.zip |
Thanks @htibosch ! |
I saw that the coverage was still no 100% and repaired that in these source files: source\FreeRTOS_DNS_Parser.c I had forgotten the new I could also make this simplification: - pxIPHeader->ulSourceIPAddress = ( pxEndPoint != NULL ) ? pxEndPoint->ipv4_settings.ulIPAddress : 0U;
+ pxIPHeader->ulSourceIPAddress = pxEndPoint->ipv4_settings.ulIPAddress; because |
/bot run formatting |
39840e9
to
56c9f60
Compare
Description
When name queries (mDNS/LLMNR/NBNS) need to be responded to, the current code searches for an end-point to use when sending the response. This PR gets rid of this search and uses the end-point on which the original request was received. This removes the possibility of a malformed request causing responses to be sent on other interfaces.
A lot more details can be found in #1042
I am not sure if any test are being affected by this change.
I have also removed
prvFindEndPointOnNetMask( NetworkBufferDescriptor_t * pxNetworkBuffer )
since it is no longer used. I also believe the whole premise of having a function that searches for and end-point to be used for a response is incorrect. Any response should be using the end-point of the original request, but this is just my opinion. Please let me know what you think and if you believe I should keep this function in the codebase even though it is no longer used.Related Issue
#1042
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.