Skip to content

Fix zero MTU on added peers - #169

Merged
jk-ozlabs merged 2 commits into
CodeConstruct:mainfrom
jk-ozlabs:dev/peer-min-mtu
Aug 18, 2026
Merged

Fix zero MTU on added peers#169
jk-ozlabs merged 2 commits into
CodeConstruct:mainfrom
jk-ozlabs:dev/peer-min-mtu

Conversation

@jk-ozlabs

Copy link
Copy Markdown
Member

v2.6 introduces a regression where peers are added with a zero MTU, rather than the interface-defined minimum, as we were adding the peer routes before setting peer->mtu.

Move the default-MTU initialisation to the peer constructor instead.

We would like to test MTU values in newly-added routes, so parse the
RTAX_MTU (from the nested RTA_METRICS attribute) in
NLSocket._parse_route(), and use the parsed valuq in the Route
constructor.

This resolves a pending TODO.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
Commit 83cbe46 moved peer route creation to an earlier point, before
the peer->mtu had been set in setup_added_peer(). This means we never
use the minimum MTU value in created routes, so lose the safety of a
known-good MTU setting.

The setup_added_peer() path is really the wrong place for MTU
initialisation; this is for property querying. Instead, set the initial
MTU when the peer is constructed.

Fixes: 83cbe46 ("mctpd: remove add_peer_route() from setup_added_peer()")
Reported-by: Brian McKenzie <Brian.McKenzie@amd.com>
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
@jk-ozlabs
jk-ozlabs merged commit f033b5f into CodeConstruct:main Aug 18, 2026
3 checks passed
@jk-ozlabs
jk-ozlabs deleted the dev/peer-min-mtu branch August 19, 2026 04:18
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.

1 participant