From 6d9f11cd32df13b279d8ff67aa9dfbd3d9659752 Mon Sep 17 00:00:00 2001 From: Liam Kearney Date: Thu, 30 Jul 2026 09:23:34 +0000 Subject: [PATCH] [macsecorch]: Default-initialize m_enable_post to false 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 --- orchagent/macsecorch.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/orchagent/macsecorch.h b/orchagent/macsecorch.h index 6673f701018..6ce782f815b 100644 --- a/orchagent/macsecorch.h +++ b/orchagent/macsecorch.h @@ -62,7 +62,7 @@ class MACsecOrch : public Orch DBConnector * m_state_db; shared_ptr m_notificationsDb; NotificationConsumer* m_postCompletionNotificationConsumer; - bool m_enable_post; + bool m_enable_post = false; PortsOrch * m_port_orch;