Skip to content

wolfIP_poll refactor#133

Open
gasbytes wants to merge 4 commits into
wolfSSL:masterfrom
gasbytes:wolfip_poll-refactor
Open

wolfIP_poll refactor#133
gasbytes wants to merge 4 commits into
wolfSSL:masterfrom
gasbytes:wolfip_poll-refactor

Conversation

@gasbytes

@gasbytes gasbytes commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Divided by the phases devices poll, timers, socket callbacks and the final per-protocol tx flush of the buffer. In particular on the last phase, udp and icmp share quite a lot of the same logic so now are merged into one single flush function called "flush_datagram_tx", the udp logic is gated with a flag (is_udp) for the new udp-only behaviors.

Mainly extracted the phases into separated static helpers, minor
removal of some dupplicates and superflous part of the code (mostly
repetitions)
@gasbytes gasbytes self-assigned this Jun 11, 2026
gasbytes added 3 commits June 12, 2026 03:04
We only do the actual poll once with the offset to differ between the
two branches
The is_udp flag was introduced to differ in 4 bits where udp does
something different from icmp:
- any multicast interaction (this includes the next jump (hop) and the
  loopback);
- tx_drained logic (that checks if we sent at least one datagram), so
  that we can "wake" the sender whenever we actually have freed some
  space in the buffer;

One minor bit is the notify logic was using t->S instead of directly
using the stack pointer already passed into the function.
@gasbytes gasbytes changed the title Initial wolfIP_poll refactor wolfIP_poll refactor Jun 12, 2026
@gasbytes gasbytes marked this pull request as ready for review June 12, 2026 10:51
@gasbytes gasbytes assigned danielinux and unassigned gasbytes Jun 12, 2026
@gasbytes gasbytes requested review from danielinux and philljj June 12, 2026 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants