diff options
author | Toni Uhlig <matzeton@googlemail.com> | 2020-07-01 17:30:25 +0200 |
---|---|---|
committer | Toni Uhlig <matzeton@googlemail.com> | 2020-07-01 17:30:25 +0200 |
commit | 18d8c95e411a269817e93f21613ed63f6a344ac3 (patch) | |
tree | 8fc0595c8d1d61d7c5d921051df96e7c251f4f9c | |
parent | 0ac0118f668e59ff7adcd6bf098b2bc9111cb686 (diff) | |
parent | c3bd138805b9ef9f8cb9a5e02a371449f9871600 (diff) |
Merge branch 'master' of ssh://git.lan:/git/ptunnel
-rw-r--r-- | src/pdesc.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/pdesc.c b/src/pdesc.c index 78bf1cd..bcae1c4 100644 --- a/src/pdesc.c +++ b/src/pdesc.c @@ -197,6 +197,7 @@ int queue_packet(int sock_fd, proxy_desc_t *cur, char *buf, size_t bufsiz, icmp_echo_packet_t *pkt = 0; ping_tunnel_pkt_t *pt_pkt = 0; uint16_t ack_val; + uint8_t * icmp_chksm_ptr; assert(sock_fd >= 0); assert(cur); @@ -230,7 +231,8 @@ int queue_packet(int sock_fd, proxy_desc_t *cur, char *buf, size_t bufsiz, /* Copy user data */ if (buf && bufsiz > 0) memcpy(pt_pkt->data, buf, bufsiz); - pkt->checksum = htons(calc_icmp_checksum((uint16_t*)pkt, pkt_len)); + icmp_chksm_ptr = (uint8_t*)pkt; + pkt->checksum = htons(calc_icmp_checksum((uint16_t*)icmp_chksm_ptr, pkt_len)); /* Send it! */ pt_log(kLog_sendrecv, "Send: %4d [%4d] bytes " |