Skip to content

Conversation

@SpadeMomo
Copy link

This commit fix various RFC violations found in message.c.

  1. In Update message, this commit add a check to ignore the whole enclosing TLV if the mandatory bit of a sub-TLV is set. This commit also add a check to ensure that if AE is 3, Omitted must be zero.
  2. In IHU message, this commit add similar mandatory bit check for sub-TLVs.
  3. Add checks for interval != 0 in various locations as RFC states that interval must not be zero.
  4. Remove Reserved == 0 checks from various locations, as RFC states that they must be ignored on recepton.
  5. Add checks for router_id that ensure they must not be all zeros or all ones.
  6. Add sub-TLV handling logic to various message types.

This commit fix various RFC violations found in `message.c`.

1. In Update message, this commit add a check to ignore the whole
   enclosing TLV if the mandatory bit of a sub-TLV is set. This
   commit also add a check to ensure that if AE is 3, Omitted must
   be zero.
2. In IHU message, this commit add similar mandatory bit check for
   sub-TLVs.
3. Add checks for `interval != 0` in various locations as RFC states
   that interval must not be zero.
4. Remove `Reserved == 0` checks from various locations, as RFC states
   that they must be ignored on recepton.
5. Add checks for `router_id` that ensure they must not be all zeros
   or all ones.
6. Add sub-TLV handling logic to various message types.

Signed-off-by: spademomo <[email protected]>
Copy link
Member

@riw777 riw777 left a comment

Choose a reason for hiding this comment

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

looks good

@riw777
Copy link
Member

riw777 commented Dec 30, 2025

need to fix lint failures ...

@SpadeMomo
Copy link
Author

Thank you for you review! I will fix the lint issue soon.

nh = neigh->address;
}

// Add check that if AE (message[2]) is 3 (link-local IPv6), then Omitted (message[5]) must be 0
Copy link
Member

Choose a reason for hiding this comment

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

Can we drop this (most likely for AI-assisted coding) comment?

Copy link
Member

Choose a reason for hiding this comment

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

And is this related to rfc8966 previous (mandatory bit) handling?

flog_err(EC_BABEL_PACKET,
"Received router id with all-ones value.");
goto fail;
}
Copy link
Member

Choose a reason for hiding this comment

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

The have_router_id flag is set to 1 before validation checks at lines 684-693. When validation fails (all-zero or all-ones router_id), the code exits via goto fail, but have_router_id remains 1 with an invalid router_id value. This causes subsequent MESSAGE_UPDATE messages in the same packet to incorrectly fail validation because they see have_router_id = 1 but router_id contains an invalid value, even though the original MESSAGE_ROUTER_ID TLV was rejected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants