Skip to content
New issue

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

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

Already on GitHub? # to your account

sys/net/uhcp: remove unused returned value in uhcp_client #12588

Merged
merged 1 commit into from
Oct 28, 2019

Conversation

aabadie
Copy link
Contributor

@aabadie aabadie commented Oct 27, 2019

Contribution description

This PR is an obvious fix removing a return value set in a variable that is never used afterward.

The ideal fix would be to take into account the return code in case of an error but that would need an API change in uhcp.

Testing procedure

Run TOOLCHAIN=llvm make -C examples/gnrc_border_router/ scan-build

With this PR the warning related to uhcp is gone.

Issues/PRs references

Tick another item in #11852

@aabadie aabadie added Area: network Area: Networking Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Oct 27, 2019
@aabadie aabadie requested a review from kaspar030 October 27, 2019 18:10
@benpicco
Copy link
Contributor

Better just return immediately if sock_udp_create() fails.

Also line 47 should be int res = sock_udp_recv(… now.

@@ -37,7 +37,7 @@ void uhcp_client(uhcp_iface_t iface)
req.prefix_len = 64;

/* create listening socket */
int res = sock_udp_create(&sock, &local, NULL, 0);
sock_udp_create(&sock, &local, NULL, 0);
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be handled...

@aabadie aabadie force-pushed the pr/net/uhcp_scan_build branch from 4e8895f to a939981 Compare October 28, 2019 14:14
@aabadie
Copy link
Contributor Author

aabadie commented Oct 28, 2019

Ok, I changed this PR to take into account the return code and return immediately with an error message.

Copy link
Contributor

@benpicco benpicco left a comment

Choose a reason for hiding this comment

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

Now the error is handled properly.

@aabadie aabadie merged commit 110957c into RIOT-OS:master Oct 28, 2019
@aabadie aabadie deleted the pr/net/uhcp_scan_build branch October 28, 2019 15:39
@fjmolinas fjmolinas added this to the Release 2020.01 milestone Dec 13, 2019
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Area: network Area: Networking CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants