Zephyr TCP/IP replacement#114
Conversation
danielinux
commented
May 11, 2026
- Added routing tables support for IPv4 routing
- Added patches to replace stock TCP/IP from Zephyr with wolfIP
There was a problem hiding this comment.
Pull request overview
This PR extends wolfIP with an IPv4 routing table (static routes + longest-prefix-match selection) and adds an out-of-tree Zephyr port that replaces Zephyr’s native IPv4/TCP/UDP stack with wolfIP via a custom L2 and socket-offload integration.
Changes:
- Added routing table storage and public APIs (
wolfIP_route_*) plus route-aware next-hop/interface selection. - Added a DNS server getter API (
wolfIP_dns_server_get) and accompanying unit tests. - Added Zephyr port documentation and patch set (glue layer, L2 module, net-shell integration, and a TAP echo sample).
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
wolfip.h |
Adds route info struct, route API declarations, and POSIX-type inclusion tweaks; adds DNS server getter prototype. |
src/wolfip.c |
Implements route table, LPM route lookup, route-aware nexthop/egress selection, and DNS server getter. |
src/test/unit/unit.c |
Registers new unit tests for routing table behavior and DNS getter. |
src/test/unit/unit_tests_proto.c |
Adds unit tests covering route LPM, default route deletion/fallback, update semantics, and connected-subnet precedence; adds DNS getter test. |
port/zephyr/README.md |
Documents the Zephyr port design, usage, patch structure, and limitations. |
port/zephyr/patches/0001-wolfip-glue-and-public-api.patch |
Adds Zephyr glue/runtime, control wrappers, Kconfig/CMake integration, and public Zephyr header. |
port/zephyr/patches/0002-net-l2-wolfip-module.patch |
Adds NET_L2_WOLFIP to intercept raw Ethernet frames and delegate L3+ to wolfIP. |
port/zephyr/patches/0003-net-shell-wolfip.patch |
Makes Zephyr net-shell commands work when wolfIP is enabled (route/arp/ipv4/dhcp/ping/tcp/udp, etc.). |
port/zephyr/patches/0004-sample-wolfip-tap-echo.patch |
Adds a Zephyr native_sim TAP-based TCP/UDP echo sample using wolfIP. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #114
Scan targets checked: wolfip-bugs, wolfip-src
Findings: 1
Low (1)
Functional inconsistency in TX interface selection and MAC address derivation
Function: wolfIP_select_nexthop_ex, ip_output_add_header, wolfIP_ll_send_frame, arp_lookup
Category: Logic Error
The routed tx_if from wolfIP_select_nexthop_ex is used for wolfIP_ll_send_frame and arp_lookup operations, while ip_output_add_header still derives the Ethernet source MAC from wolfIP_socket_if_idx(t). This represents a functional inconsistency where different code paths may select different interfaces for routing decisions and MAC address derivation.
Recommendation: Verify that the MAC address derivation in ip_output_add_header is correctly synchronized with the interface selected by wolfIP_select_nexthop_ex, or document the intentional separation of concerns if this behavior is by design. This should be verified to ensure consistent interface selection across the TX path.
This review was generated automatically by Fenrir. Findings are non-blocking.
|
Fenrir has a point in its comment, but the refactor needed is outside the scope for this PR, and there is no functional issue associated, so leaving as is. |