summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Klinghed <the_jk@yahoo.com>2017-07-30 00:51:06 +0200
committerJoel Klinghed <the_jk@yahoo.com>2017-07-30 00:51:06 +0200
commit1536057d4a357f28ba27407cc2294527f85b8fd4 (patch)
treead05d9fdb3f8cca359fc366d33779d5c5a9e26ca
parent124429985be8033a398b891f400f70a058330c87 (diff)
Fix tcp checksum computation in pcap save
-rw-r--r--src/monitor-gui.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/monitor-gui.cc b/src/monitor-gui.cc
index 0670b80..ea2132c 100644
--- a/src/monitor-gui.cc
+++ b/src/monitor-gui.cc
@@ -1389,7 +1389,7 @@ private:
sum += (data[i * 2] << 8) | data[i * 2 + 1];
}
if (size % 2) sum += data[size - 1] << 8;
- return ~size;
+ return ~sum;
}
#else // HAVE_PCAP
static bool is_pcap(std::string const&) {