You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix null pointer dereference in MrpRelay when hasStp is false
MrpRelay::isForwardingInterface() and handleLowerPacket() dereferenced
MrpInterfaceData and Ieee8021dInterfaceData pointers without null checks.
When hasMrp=true but hasStp=false (e.g. MrpSwitch), Ieee8021dInterfaceData
is not added to interfaces, causing a segfault (signal 139).
Added null checks: missing MrpInterfaceData now throws a cRuntimeError
with a clear message about enabling hasMrp. Missing Ieee8021dInterfaceData
is treated as forwarding (following the base class Ieee8021dRelay pattern),
since the STP protocol is simply not active.
if (mrpInterfaceData->getRole() != MrpInterfaceData::NOTASSIGNED
82
+
if (!mrpInterfaceData)
83
+
throwcRuntimeError("MrpInterfaceData not found on interface '%s'; enable hasMrp in the network node configuration", incomingInterface->getInterfaceName());
84
+
if ((mrpInterfaceData->getRole() != MrpInterfaceData::NOTASSIGNED)
83
85
&& isMrpMulticast(destinationAddress)) {
84
86
//Mrp-Multicast Handling, forwarding to RingPort according to MrpFilteringDatabase in case incoming interface is not filtering, send up if registered
85
87
auto outgoingInterfaceIds = mrpMacForwardingTable->getMrpForwardingInterfaces(destinationAddress, vlanId);
throwcRuntimeError("MrpInterfaceData not found on interface '%s'; enable hasMrp in the network node configuration", networkInterface->getInterfaceName());
0 commit comments