Skip to content

fix(fsm): omit Extensions Supported from Session Initialization when none are advertised - #1

Merged
asmie merged 1 commit into
asmie:masterfrom
athola:fix/omit-empty-extensions-supported
Oct 5, 2026
Merged

asmie merged 1 commit into
asmie:masterfrom
athola:fix/omit-empty-extensions-supported

Conversation

@athola

@athola athola commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

The router always puts an Extensions Supported data item in its Session
Initialization message, even when it advertises no extensions, so it sends a
zero-length item. OLSR/OONF's DLEP modem (dlep_radio, commit 477e716)
refuses it and resets the session:

WARN(dlep_radio) dlep_session.c 938: TLV 6 has wrong size, 0 is not between 2 and 65534
WARN(dlep_radio) dlep_session.c 455: Parser error: -5

The router then sees session down: StatusCode(129).

RFC 8175 §12.5: "If DLEP extensions are supported, the Session Initialization
Message MUST contain an Extensions Supported Data Item", and "If an Extensions
Supported Data Item does not exist in a Session Initialization Message, the
modem MUST conclude that there is no support for extensions in the router."
Leaving the item out is how the RFC says "none", and this crate's modem
already reads an absent item that way.

This change sends the item only when advertised_extensions is non-empty. The
codec is unchanged and still round-trips an empty item.

With the change, a session between this crate's router and OONF's modem comes
up and the modem's session metrics arrive.

Tests, in crates/dlep-fsm/tests/session_table.rs:

  • router_session_init_omits_extensions_supported_when_none_are_advertised
    fails without the change.
  • router_session_init_lists_the_extensions_it_advertises

cargo test --workspace --no-fail-fast in a Linux container gives the same
results before and after apart from the new tests: 9 IPv6 and multi-interface
discovery tests fail there either way, which looks like the container's
network rather than this change. Clippy (-D warnings) and rustfmt are clean.

build_session_initialization_response on the modem side does the same. I
left it alone to keep this small, and because an existing test counts the
response's items. Happy to change it the same way if you want that.

…none are advertised

RFC 8175 section 12.5 has the router include Extensions Supported when it
supports extensions, and has the modem read an absent item as none. The
router sent a zero-length item instead, which stricter modems reject:
OLSR/OONF's dlep_radio resets the session with "TLV 6 has wrong size". The
item is now sent only when advertised_extensions is non-empty.
@asmie
asmie self-requested a review October 5, 2026 21:02

@asmie asmie left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

LGTM

@asmie
asmie merged commit 1c44bf1 into asmie:master Oct 5, 2026
7 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.

2 participants