bug 1396: ARP with hardware addresses longer than 6 bytes
authorMike Moreton <mjvm_ns@hotmail.com>
Sat, 26 May 2012 06:47:56 -0700
changeset 8808 156662c93da6
parent 8807 fcb718d36baa
child 8809 297f6cd5af9a
bug 1396: ARP with hardware addresses longer than 6 bytes
src/internet/model/arp-header.cc
--- a/src/internet/model/arp-header.cc	Fri May 25 11:45:23 2012 -0700
+++ b/src/internet/model/arp-header.cc	Sat May 26 06:47:56 2012 -0700
@@ -121,8 +121,13 @@
 uint32_t 
 ArpHeader::GetSerializedSize (void) const
 {
-  /* this is the size of an ARP payload. */
-  return 28;
+  NS_ASSERT((m_macSource.GetLength () == 6) || (m_macSource.GetLength () == 8));
+  NS_ASSERT (m_macSource.GetLength () == m_macDest.GetLength ());
+
+  uint32_t length = 16;   // Length minus two hardware addresses
+  length += m_macSource.GetLength () * 2;
+
+  return length;
 }
 
 void