aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMasaq- <tilt@techie.com>2019-02-28 02:13:29 +0000
committerMasaq- <tilt@techie.com>2019-02-28 02:13:29 +0000
commitf5f395ed7211e39825745da63a2a713e2679c17a (patch)
treebc10bdc5943ee39d1a9a2a7a77bc5acd04364e7c
parent70973ac736e8b669f121a4c96b510e451fd130fc (diff)
initialize checksum
-rw-r--r--src/ptunnel.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/ptunnel.c b/src/ptunnel.c
index fad0944..ff92937 100644
--- a/src/ptunnel.c
+++ b/src/ptunnel.c
@@ -672,6 +672,7 @@ void* pt_proxy(void *args) {
for (uint16_t e = 0; e < opts.empty_pings; e++) {
cur->send_ring[idx].pkt->seq = htons(cur->ping_seq);
cur->ping_seq++;
+ cur->send_ring[idx].pkt->checksum = 0;
cur->send_ring[idx].pkt->checksum = htons(calc_icmp_checksum((uint16_t*)cur->send_ring[idx].pkt, sizeof(icmp_echo_packet_t)));
sendto(fwd_sock, (const void*)cur->send_ring[idx].pkt, sizeof(icmp_echo_packet_t),
0, (struct sockaddr*)&cur->dest_addr, sizeof(struct sockaddr));