Skip to content

Fix/#77/udp mss instead of mtu#80

Merged
JPHutchins merged 3 commits intomainfrom
fix/#77/udp-mss-instead-of-mtu
Oct 12, 2025
Merged

Fix/#77/udp mss instead of mtu#80
JPHutchins merged 3 commits intomainfrom
fix/#77/udp-mss-instead-of-mtu

Conversation

@JPHutchins
Copy link
Collaborator

No description provided.

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 fixes issue #77 by implementing proper MSS (Maximum Segment Size) calculation instead of using MTU directly for UDP transport. The change prevents fragmentation by accounting for IPv4/IPv6 and UDP header overhead when determining maximum payload size.

  • Adds IPv4/IPv6 auto-detection to calculate appropriate overhead (28 bytes for IPv4, 48 bytes for IPv6)
  • Implements proper MSS calculation by subtracting protocol overhead from MTU per RFC 8085
  • Updates configuration files for improved linting and VS Code settings

Reviewed Changes

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

File Description
smpclient/transport/udp.py Implements MSS calculation with IPv4/IPv6 detection and protocol overhead constants
tests/test_smp_udp_transport.py Adds comprehensive tests for MSS calculation and IPv4/IPv6 detection
envr-default Updates lint command to show diff output for isort
.vscode/settings.json Updates VS Code settings for isort integration

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@JPHutchins JPHutchins linked an issue Oct 12, 2025 that may be closed by this pull request
@JPHutchins JPHutchins merged commit 0576bcc into main Oct 12, 2025
25 checks passed
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.

UDP: Use MSS instead of MTU for max size

2 participants