store length type field in ethernet packets in network order.
authorGuillaume Vu-Brugier <gvubrugier@gmail.com>
Fri Mar 07 11:36:33 2008 -0800 (2008-03-07)
changeset 2360ff54bd92e43c
parent 2359 cbe5d6629daf
child 2361 743e0e351379
child 2362 d02b7fd0e577
store length type field in ethernet packets in network order.
src/node/ethernet-header.cc
     1.1 --- a/src/node/ethernet-header.cc	Thu Mar 06 19:14:52 2008 +0000
     1.2 +++ b/src/node/ethernet-header.cc	Fri Mar 07 11:36:33 2008 -0800
     1.3 @@ -149,7 +149,7 @@
     1.4      }
     1.5    WriteTo (i, m_destination);
     1.6    WriteTo (i, m_source);
     1.7 -  i.WriteU16 (m_lengthType);
     1.8 +  i.WriteHtonU16 (m_lengthType);
     1.9  }
    1.10  uint32_t
    1.11  EthernetHeader::Deserialize (Buffer::Iterator start)
    1.12 @@ -163,7 +163,7 @@
    1.13  
    1.14    ReadFrom (i, m_destination);
    1.15    ReadFrom (i, m_source);
    1.16 -  m_lengthType = i.ReadU16 ();
    1.17 +  m_lengthType = i.ReadNtohU16 ();
    1.18  
    1.19    return GetSerializedSize ();
    1.20  }