fix opt warnings, let compiler do tail call optimization in csma nd, remove protected access from router iface

This commit is contained in:
Craig Dowell
2007-08-06 14:40:43 -07:00
parent caf9c39afa
commit b8458246b8
2 changed files with 14 additions and 8 deletions

View File

@@ -477,13 +477,15 @@ CsmaCdNetDevice::Receive (const Packet& packet)
// Only receive if send side of net device is enabled
if (!IsReceiveEnabled())
{
goto drop;
m_dropTrace (p);
return;
}
if (m_encapMode == RAW)
{
ForwardUp (packet, 0, GetBroadcast ());
goto drop;
m_dropTrace (p);
return;
}
p.RemoveTrailer(trailer);
trailer.CheckFcs(p);
@@ -495,10 +497,15 @@ CsmaCdNetDevice::Receive (const Packet& packet)
(header.GetDestination() != destination))
{
// not for us.
goto drop;
m_dropTrace (p);
return;
}
//
// protocol must be initialized to avoid a compiler warning in the RAW
// case that breaks the optimized build.
//
uint16_t protocol = 0;
uint16_t protocol;
switch (m_encapMode)
{
case ETHERNET_V1:
@@ -518,8 +525,6 @@ CsmaCdNetDevice::Receive (const Packet& packet)
m_rxTrace (p);
ForwardUp (p, protocol, header.GetSource ());
return;
drop:
m_dropTrace (p);
}
Ptr<Queue>

View File

@@ -550,7 +550,7 @@ public:
*/
bool GetLSA (uint32_t n, GlobalRouterLSA &lsa) const;
protected:
private:
virtual ~GlobalRouter ();
void ClearLSAs (void);
@@ -564,13 +564,14 @@ protected:
Ipv4Address m_routerId;
private:
// inherited from Object
virtual void DoDispose (void);
/**
* @brief Global Router copy construction is disallowed.
*/
GlobalRouter (GlobalRouter& sr);
/**
* @brief Global Router assignment operator is disallowed.
*/