Skip to content

examples/gcoap: add IPv4 support#17763

Merged
benpicco merged 3 commits intoRIOT-OS:masterfrom
HendrikVE:pr/examples_gcoap_ipv4_support
Oct 19, 2022
Merged

examples/gcoap: add IPv4 support#17763
benpicco merged 3 commits intoRIOT-OS:masterfrom
HendrikVE:pr/examples_gcoap_ipv4_support

Conversation

@HendrikVE
Copy link
Contributor

@HendrikVE HendrikVE commented Mar 7, 2022

Contribution description

Add IPv4 support to examples/gcoapand examples/gcoap_dtls.

Dual stack mode using IPv4 and IPv6 would require some changes on the gcoap API, therefore compilation stops with an error right now.

Testing procedure

Use the example applications to connect by IPv4 instead of IPv6 by compiling with LWIP_IPV4=1

Issues/PRs references

Dependencies:

@github-actions github-actions bot added Area: CoAP Area: Constrained Application Protocol implementations Area: examples Area: Example Applications Area: network Area: Networking Area: pkg Area: External package ports Area: sys Area: System Area: tests Area: tests and testing framework labels Mar 7, 2022
@HendrikVE HendrikVE force-pushed the pr/examples_gcoap_ipv4_support branch from e1ac0b0 to 88741d2 Compare March 25, 2022 16:22
@github-actions github-actions bot removed the Area: tests Area: tests and testing framework label Mar 25, 2022
@benpicco benpicco added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Mar 26, 2022
@HendrikVE HendrikVE force-pushed the pr/examples_gcoap_ipv4_support branch from 88741d2 to a310b65 Compare March 26, 2022 13:45
@github-actions github-actions bot removed the Area: pkg Area: External package ports label Mar 26, 2022
@HendrikVE
Copy link
Contributor Author

Mhh CI does not like my exemption of the gcoap from dual-stack use. Is there a way to silence this case? I did not plan to fix this limitation in gcoap for now.

@benpicco
Copy link
Contributor

benpicco commented Jun 1, 2022

What in GCoAP is it that breaks when both IPv4 and IPv6 are enabled?

@HendrikVE
Copy link
Contributor Author

HendrikVE commented Jun 3, 2022

What in GCoAP is it that breaks when both IPv4 and IPv6 are enabled?

I'm not entirely sure what is was right now, but I believe the problem was that I was not able to receive messages. The message was sent out but the socket was not able to receive anything.

Somewhere I read that RIOT does not handle dual stack very well, so this might be part of the problem. Unfortunately, the way gcoap is designed with the _event_loop makes it tricky to pass the IP version to be used and as stated above I had problems with AF_UNSPEC.

@HendrikVE HendrikVE force-pushed the pr/examples_gcoap_ipv4_support branch 2 times, most recently from c80eb5c to 7e31f96 Compare June 3, 2022 14:04
Copy link
Member

@maribu maribu left a comment

Choose a reason for hiding this comment

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

Code looks good to me. Some style nitpicks inline

@HendrikVE HendrikVE force-pushed the pr/examples_gcoap_ipv4_support branch 3 times, most recently from ad8c177 to a084559 Compare June 9, 2022 13:18
@HendrikVE HendrikVE force-pushed the pr/examples_gcoap_ipv4_support branch from a084559 to e8eed90 Compare October 10, 2022 07:58
@HendrikVE
Copy link
Contributor Author

Rebased to master. Therefore I had to add ipv4_addr_is_multicast.

@riot-ci
Copy link

riot-ci commented Oct 10, 2022

Murdock results

✔️ PASSED

9f7c898 examples/gcoap_dtls: add IPv4 support

Success Failures Total Runtime
1987 0 1987 07m:07s

Artifacts

This only reflects a subset of all builds from https://ci-prod.riot-os.org. Please refer to https://ci.riot-os.org for a complete build for now.

@aabadie aabadie added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Oct 10, 2022
@HendrikVE HendrikVE force-pushed the pr/examples_gcoap_ipv4_support branch from e8eed90 to 9f7c898 Compare October 18, 2022 08:59
@benpicco benpicco merged commit 49d6604 into RIOT-OS:master Oct 19, 2022
@HendrikVE HendrikVE deleted the pr/examples_gcoap_ipv4_support branch October 20, 2022 12:58
@HendrikVE
Copy link
Contributor Author

Thanks for the reviews!

@kaspar030 kaspar030 added this to the Release 2023.01 milestone Jan 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: CoAP Area: Constrained Application Protocol implementations Area: examples Area: Example Applications Area: network Area: Networking Area: sys Area: System CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants