Skip to content

Add selection of MTU value per-interface#77

Merged
gasbytes merged 5 commits intowolfSSL:masterfrom
danielinux:iface-mtu
Mar 13, 2026
Merged

Add selection of MTU value per-interface#77
gasbytes merged 5 commits intowolfSSL:masterfrom
danielinux:iface-mtu

Conversation

@danielinux
Copy link
Member

No description provided.

Copilot AI review requested due to automatic review settings March 12, 2026 14:04
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces per-interface MTU awareness in wolfIP so that transmit sizing (UDP/ICMP payload limits and TCP MSS/segmentation) can be constrained by an interface’s effective MTU, and exposes new APIs to set/get that MTU.

Changes:

  • Add mtu to struct wolfIP_ll_dev plus wolfIP_mtu_set() / wolfIP_mtu_get() public APIs.
  • Update TCP MSS advertisement/segmentation and UDP/ICMP send size checks to use the effective per-socket/interface MTU.
  • Add/extend unit tests and update API documentation to cover the MTU behavior.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
wolfip.h Adds ll_dev.mtu field and declares MTU set/get APIs.
src/wolfip.c Implements MTU helpers/API and routes TCP/UDP/ICMP sizing + link I/O paths through the effective MTU.
src/test/unit/unit.c Adds tests validating MTU clamping and that UDP/ICMP/TCP respect MTU-derived limits/MSS.
docs/API.md Documents the new MTU field and MTU set/get APIs.
config.h Introduces LINK_MTU_MIN with a build-time consistency check.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@gasbytes gasbytes merged commit 1cf2a04 into wolfSSL:master Mar 13, 2026
20 checks passed
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +2330 to +2334
if (include_ts && (uint8_t)(opt_len + sizeof(*ts)) <= max_opt_len) {
ts = (struct tcp_opt_ts *)opt;
ts->opt = TCP_OPTION_TS;
ts->len = TCP_OPTION_TS_LEN;
ts->val = ee32(t->S->last_tick & 0xFFFFFFFFU);
Comment on lines +2341 to 2343
while ((opt_len % 4) != 0 && opt_len < max_opt_len) {
*opt++ = TCP_OPTION_NOP;
opt_len++;
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