From: Richard Whitehouse Date: Sun, 20 Feb 2011 02:29:52 +0000 (+0000) Subject: Only update port if expiration is not in the future X-Git-Url: https://git.richardwhiuk.com/?a=commitdiff_plain;h=d9339f4742dae354858839fa9cd6659c601857c4;p=ns-moose.git Only update port if expiration is not in the future --- 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; }