View | Details | Raw Unified | Return to bug 367
Collapse All | Expand All

(-)a/src/devices/wifi/wifi-net-device.cc (-2 / +11 lines)
 Lines 28-33    Link Here 
28
#include "ns3/pointer.h"
28
#include "ns3/pointer.h"
29
#include "ns3/node.h"
29
#include "ns3/node.h"
30
#include "ns3/trace-source-accessor.h"
30
#include "ns3/trace-source-accessor.h"
31
#include "ns3/log.h"
32
33
NS_LOG_COMPONENT_DEFINE ("WifiNetDevice");
31
34
32
namespace ns3 {
35
namespace ns3 {
33
36
 Lines 340-357    Link Here 
340
void
343
void
341
WifiNetDevice::LinkUp (void)
344
WifiNetDevice::LinkUp (void)
342
{
345
{
346
  NS_LOG_FUNCTION (this);
347
  bool wasUp = m_linkUp;
343
  m_linkUp = true;
348
  m_linkUp = true;
344
  if (!m_linkChange.IsNull ())
349
  if (!wasUp && !m_linkChange.IsNull ())
345
    {
350
    {
351
      NS_LOG_LOGIC ("link changed");
346
      m_linkChange ();
352
      m_linkChange ();
347
    }
353
    }
348
}
354
}
349
void
355
void
350
WifiNetDevice::LinkDown (void)
356
WifiNetDevice::LinkDown (void)
351
{
357
{
358
  NS_LOG_FUNCTION (this);
359
  bool wasUp = m_linkUp;
352
  m_linkUp = false;
360
  m_linkUp = false;
353
  if (!m_linkChange.IsNull ())
361
  if (wasUp && !m_linkChange.IsNull ())
354
    {
362
    {
363
      NS_LOG_LOGIC ("link changed");
355
      m_linkChange ();
364
      m_linkChange ();
356
    }
365
    }
357
}
366
}

Return to bug 367