sock_dns: correctly report too short messages [backport 2019.01]#10900
Conversation
(cherry picked from commit b30cdb5)
|
is it normal that we have a big green merge button without having a reviewer ACK ? My guess is that a configuration is missing for the 2019.01-branch protection. |
You are the release manager. Did you follow https://github.com/RIOT-OS/RIOT/wiki/%5Bdraft%5D-Managing-a-Release. It told you to do it ;-). |
It might be, that you need special permission for that though :-/. Maybe that's a bug in the script that it does not warn you, if you used that. |
|
Just noticed that GitHub now also allows to set branch-protection based on a pattern that matches the branch-name. I added the rule for the |
I'm a lazy guy so I used that very useful script :)
Thanks ! |
aabadie
left a comment
There was a problem hiding this comment.
Changes are the same as in original PR.
ACK and go.
Backport of #10896
Contribution description
While writing the tests I promised in #10740 I noticed this bug.
sock_dns_query()returns the length of a too short DNS response instead of just reporting that it is wrong. While this is not severe, it can lead to confusing behavior, as the function does not report an error but just a number>0. This basically means,sock_dns_query()will tell the user that the address is whatever currently is on the stack ;-).Testing procedure
After the interface configuration described in the README of
tests/gnrc_sock_dnsstart the application (but not thednsmasq) and the following command in a separate terminalWithout this PR the response the output will be
With it correctly reports
Issues/PRs references
None, but found while working on https://github.com/miri64/RIOT/tree/tests/enh/gnrc_sock_dns/tests/gnrc_sock_dns