store length type field in ethernet packets in network order.
authorGuillaume Vu-Brugier <gvubrugier@gmail.com>
Fri, 07 Mar 2008 11:36:33 -0800
changeset 2360 ff54bd92e43c
parent 2359 cbe5d6629daf
child 2361 743e0e351379
child 2362 d02b7fd0e577
store length type field in ethernet packets in network order.
src/node/ethernet-header.cc
--- a/src/node/ethernet-header.cc	Thu Mar 06 19:14:52 2008 +0000
+++ b/src/node/ethernet-header.cc	Fri Mar 07 11:36:33 2008 -0800
@@ -149,7 +149,7 @@
     }
   WriteTo (i, m_destination);
   WriteTo (i, m_source);
-  i.WriteU16 (m_lengthType);
+  i.WriteHtonU16 (m_lengthType);
 }
 uint32_t
 EthernetHeader::Deserialize (Buffer::Iterator start)
@@ -163,7 +163,7 @@
 
   ReadFrom (i, m_destination);
   ReadFrom (i, m_source);
-  m_lengthType = i.ReadU16 ();
+  m_lengthType = i.ReadNtohU16 ();
 
   return GetSerializedSize ();
 }