dump: fix compilation on CentOS 7
Refs: #4852
Change-Id: I2550d26f709f645ee3d6b2e0f63a6698525e1a76
diff --git a/tools/dump/ndndump.cpp b/tools/dump/ndndump.cpp
index b13b7ef..d5b6571 100644
--- a/tools/dump/ndndump.cpp
+++ b/tools/dump/ndndump.cpp
@@ -454,7 +454,7 @@
}
auto th = reinterpret_cast<const tcphdr*>(pkt);
- size_t tcpHdrLen = th->th_off * 4;
+ size_t tcpHdrLen = th->TH_OFF * 4;
if (tcpHdrLen < sizeof(tcphdr)) {
out << " bad header length " << tcpHdrLen;
return true;
@@ -483,7 +483,7 @@
}
auto uh = reinterpret_cast<const udphdr*>(pkt);
- size_t udpLen = endian::big_to_native(uh->uh_ulen);
+ size_t udpLen = endian::big_to_native(uh->UH_LEN);
if (udpLen < sizeof(udphdr)) {
out << " bad length " << udpLen;
return true;