eigrpd: fix byte order in Hello authentication decode (backport #21545) - #21594
Merged
Conversation
The auth_type and length fields in EIGRP Hello TLV structures are network byte order, but several decode functions compare them against host-order constants without ntohs(). Add ntohs() to all affected comparisons: - eigrp_hello_authentication_decode: auth_type and length checks - eigrp_hello_parameter_decode: length check - eigrp_sw_version_decode: length check - eigrp_peer_termination_decode: length check Signed-off-by: Tristan Madani <tristan@live.fr> (cherry picked from commit b8e6379)
|
Target branch is not in the allowed branches list. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
eigrp_hello_authentication_decode()comparesmd5->auth_typeandmd5->lengthdirectly against host-order constants, but these struct fields are stored in network byte order (the send path useshtons()ateigrp_packet.c:1248). On little-endian hosts the comparisons never match, so authentication is silently skipped.Wrap both fields with
ntohs()to match the encoding.Signed-off-by: Tristan Madani tristan@live.fr
This is an automatic backport of pull request #21545 done by Mergify.