Bug 173

Summary: Comparing one Address to another is a PITA
Product: ns-3 Reporter: Gustavo J. A. M. Carneiro <gjcarneiro>
Component: networkAssignee: ns-bugs <ns-bugs>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P3    
Version: pre-release   
Hardware: All   
OS: All   

Description Gustavo J. A. M. Carneiro 2008-04-16 04:58:35 UTC
Because of this:

bool operator == (const Address &a, const Address &b)
{
  NS_ASSERT (a.m_type == b.m_type || 
	     a.m_type == 0 || 
	     b.m_type == 0);
  NS_ASSERT (a.GetLength() == b.GetLength());  
  return memcmp (a.m_data, b.m_data, a.m_len) == 0;
}

If I try to compare addresses of different types, NS-3 aborts.  Why?  Addresses of different types should just compare not equal, nothing more.  Especially since there is no method to get the type of a generic Address...
Comment 1 Mathieu Lacage 2008-04-16 12:16:58 UTC
looks good to me. Feel free to apply.
Comment 2 Gustavo J. A. M. Carneiro 2008-04-16 12:28:56 UTC
http://code.nsnam.org/ns-3-dev/rev/6244ea5e7831