make sure that mac addr len is correctly written
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Mon, 12 Feb 2007 23:24:00 +0100
changeset 258 df3bca25ae37
parent 257 60d6d9bb4f9a
child 259 74c16a9c19f4
make sure that mac addr len is correctly written
src/node/arp-header.cc
--- a/src/node/arp-header.cc	Mon Feb 12 23:23:30 2007 +0100
+++ b/src/node/arp-header.cc	Mon Feb 12 23:24:00 2007 +0100
@@ -114,12 +114,13 @@
 ArpHeader::SerializeTo (Buffer::Iterator start) const
 {
   Buffer::Iterator i = start;
+  assert (m_macSource.GetLength () == m_macDest.GetLength ());
 
   /* ethernet */
   i.WriteHtonU16 (0x0001);
   /* ipv4 */
   i.WriteHtonU16 (0x0800);
-  i.WriteU8 (6);
+  i.WriteU8 (m_macSource.GetLength ());
   i.WriteU8 (4);
   i.WriteHtonU16 (m_type);
   WriteTo (i, m_macSource);