Replaced shift operations on IP addresses to an endian-safer approach
authorGuilherme Maciel Ferreira <guilherme.maciel.ferreira@gmail.com>
Sat, 6 Aug 2011 19:33:09 +0000 (16:33 -0300)
committerGuilherme Maciel Ferreira <guilherme.maciel.ferreira@gmail.com>
Sat, 6 Aug 2011 19:39:57 +0000 (16:39 -0300)
commit5f08ee9ff5025777bc988f1cd0b669d4236eba65
tree5a1e44aa0979320c0ec7c40187133b2e873c7a77
parent0aea66bd756d2df11c8a3b3b0050d7b70ef74d8f
Replaced shift operations on IP addresses to an endian-safer approach
- Instead of shifts on sockaddr.sa_data, uses a cast to sockaddr_in.sin_addr.s_addr.
  And as long as the two structures have the same memory layout, the cast is safe.
- Reinterpret four chars (8 bits) as one integer (32 bits), and make it endian safe.
src/tcp/tcppinger.cpp