From d9339f4742dae354858839fa9cd6659c601857c4 Mon Sep 17 00:00:00 2001 From: Richard Whitehouse Date: Sun, 20 Feb 2011 02:29:52 +0000 Subject: [PATCH] Only update port if expiration is not in the future --- code/src/devices/bridge/model/moose-bridge-net-device.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/src/devices/bridge/model/moose-bridge-net-device.cc b/code/src/devices/bridge/model/moose-bridge-net-device.cc index b765525..05d2ef1 100644 --- a/code/src/devices/bridge/model/moose-bridge-net-device.cc +++ b/code/src/devices/bridge/model/moose-bridge-net-device.cc @@ -196,16 +196,16 @@ void MooseBridgeNetDevice::Learn(MooseAddress const& addr, Ptr state.expirationTime){ + state.associatedPort = port; // Only update if the expiration is not in the future state.expirationTime = now + m_expirationTime; } } else { PortState &state = m_portState[addr.GetMooseSuffix()]; - state.associatedPort = port; if(now + m_expirationTime > state.expirationTime){ + state.associatedPort = port; state.expirationTime = now + m_expirationTime; } -- 2.34.1