Add selection of MTU value per-interface#77
Conversation
There was a problem hiding this comment.
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
mtutostruct wolfIP_ll_devpluswolfIP_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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
| 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); |
| while ((opt_len % 4) != 0 && opt_len < max_opt_len) { | ||
| *opt++ = TCP_OPTION_NOP; | ||
| opt_len++; |
No description provided.