aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2019-02-27 13:10:23 +0100
committerToni Uhlig <matzeton@googlemail.com>2019-02-27 13:10:23 +0100
commite13b1445e76a366c90766ee5111b922f3c2bde9c (patch)
treeaf8e303a94aae24221118f2909e1b7ecdfcfa3ab
parent4b9d5c066f5ac5914ac78dfa041f3c166e729d82 (diff)
parent2d639c819bd35d799b3f32b669b47db287b07ff1 (diff)
Merge branch 'master' of ssh://github.com/lnslbrty/ptunnel-ng
-rw-r--r--src/pkt.c2
-rw-r--r--src/ptunnel.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/src/pkt.c b/src/pkt.c
index e2fd2a8..beb6291 100644
--- a/src/pkt.c
+++ b/src/pkt.c
@@ -467,6 +467,7 @@ void handle_ack(uint16_t seq_no, icmp_desc_t ring[], int *packets_awaiting_ack,
*remote_ack = (uint16_t)ntohl(pt_pkt->ack);
free(ring[i].pkt);
ring[i].pkt = 0;
+ ring[i].pkt_len = 0;
(*packets_awaiting_ack)--;
if (i == *first_ack) {
for (j=1;j<window_size;j++) {
@@ -504,6 +505,7 @@ void handle_ack(uint16_t seq_no, icmp_desc_t ring[], int *packets_awaiting_ack,
if (can_ack) {
free(ring[i].pkt);
ring[i].pkt = 0;
+ ring[i].pkt_len = 0;
(*packets_awaiting_ack)--;
}
i--;
diff --git a/src/ptunnel.c b/src/ptunnel.c
index 640df74..fad0944 100644
--- a/src/ptunnel.c
+++ b/src/ptunnel.c
@@ -668,7 +668,7 @@ void* pt_proxy(void *args) {
cur->dst_ip, cur->dst_port, kProto_ack | cur->type_flag,
&cur->dest_addr, cur->next_remote_seq, &cur->send_first_ack, &cur->ping_seq, cur->window_size);
cur->xfer.icmp_ack_out++;
- if (cur->send_ring[idx].pkt_len > sizeof(icmp_echo_packet_t) && cur->send_ring[idx].pkt->type == 8) {
+ if (cur->send_ring[idx].pkt_len > sizeof(icmp_echo_packet_t) && cur->send_ring[idx].pkt->type == kICMP_echo_request) {
for (uint16_t e = 0; e < opts.empty_pings; e++) {
cur->send_ring[idx].pkt->seq = htons(cur->ping_seq);
cur->ping_seq++;