Skip to content

[go-LIN-09] linNode.Send reports a malformed frame ID as ErrNotConnected instead of ErrInvalidFrame #71

Description

@SoundMatt

Location

adapt.go, linNode.Send.

Finding

When msg.ID fails to parse as a decimal string or is out of the valid 0-63 LIN ID range, linNode.Send wraps the error as ErrNotConnected. That sentinel is meant to describe a connection-state problem, not a structurally malformed message. The RELAY spec's own guidance treats structural violations like this as ErrInvalidFrame, and the library is inconsistent with itself here: the equivalent path on frame parsing (FromMessage in lin.go) already returns ErrInvalidFrame for the same kind of malformed-ID condition. I confirmed at current HEAD that linNode.Send still returns an error wrapping ErrNotConnected for this case.

Recommendation

Return ErrInvalidFrame (or another structurally-appropriate sentinel such as ErrPayloadTooLarge where relevant) from linNode.Send for a malformed/out-of-range ID, matching the convention already used by FromMessage.

Filed from the 2026-07-29 ecosystem audit register; independently re-verified against current HEAD before filing.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions