[macsecorch]: Default-initialize m_enable_post to false - #4802
Open
liamkearney-msft wants to merge 1 commit into
Open
[macsecorch]: Default-initialize m_enable_post to false#4802liamkearney-msft wants to merge 1 commit into
liamkearney-msft wants to merge 1 commit into
Conversation
MACsecOrch::m_enable_post is declared without an initializer and is only assigned (= true) on the "macsec-level-post-in-progress" state path. On every other path (e.g. POST/FIPS disabled) it is read as an indeterminate bool at the SAI_MACSEC_ATTR_ENABLE_POST push sites (macsecorch.cpp:1246, 1278) and the guard at 807. That can push ENABLE_POST=true on hardware that does not support POST, causing MACsec SAI object creation to fail with SAI_STATUS_ATTR_NOT_SUPPORTED and MACsec to never initialize. Default-initialize the member to false so POST is only enabled when explicitly requested by the state machine. Signed-off-by: Liam Kearney <liamkearney@microsoft.com>
Collaborator
|
/azp run |
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request prevents MACsecOrch::m_enable_post from being read as an indeterminate boolean by default-initializing it to false, ensuring MACsec POST is only enabled when explicitly requested by the POST state machine path. This avoids unintentionally pushing SAI_MACSEC_ATTR_ENABLE_POST on platforms that don’t support POST, which can otherwise cause MACsec SAI object creation failures and destabilize orchagent.
Changes:
- Default-initialize
MACsecOrch::m_enable_posttofalsein the class definition. - Ensures the existing
if (m_enable_post)guards inmacsecorch.cpponly activate when POST is explicitly enabled.
liamkearney-msft
requested review from
abdosi,
anders-nexthop,
judyjoseph,
kenneth-arista and
ysmanman
July 30, 2026 10:14
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.
MACsecOrch::m_enable_post is declared without an initializer and is only assigned (= true) on the "macsec-level-post-in-progress" state path. On every other path (e.g. POST/FIPS disabled) it is read as an indeterminate bool at the SAI_MACSEC_ATTR_ENABLE_POST push sites (macsecorch.cpp:1246, 1278) and the guard at 807. That can push ENABLE_POST=true on hardware that does not support POST, causing MACsec SAI object creation to fail with SAI_STATUS_ATTR_NOT_SUPPORTED and MACsec to never initialize.
This would tear down orchagent and wedge the entire LC
Default-initialize the member to false so POST is only enabled when explicitly requested by the state machine.
seen on arista 7800 with 202511
What I did
Why I did it
How I verified it
on local 202511 build on arista 7800 hw
Details if related