diff options
author | Toni Uhlig <matzeton@googlemail.com> | 2019-01-25 20:23:31 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-25 20:23:31 +0100 |
commit | 25a40d7249cc9f558bd23969cadfe2fe05ab9b68 (patch) | |
tree | 75b202d4b1d456d77980e6ed143e015833d8a66a | |
parent | 671d15a068e6fa3e9da8dab7f85466b0c4f9569e (diff) | |
parent | 5f64e0f141096c2f285cfdfa206506d01dafa309 (diff) |
Merge pull request #6 from Masaq-/fix-unprivileged-mode
fix unprivileged mode
-rw-r--r-- | src/pkt.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -82,7 +82,7 @@ void handle_packet(char *buf, unsigned bytes, int is_pcap, struct sockaddr_in *a sizeof(icmp_echo_packet_t) + sizeof(ping_tunnel_pkt_t), bytes); else { - if (opts.udp) { + if (opts.udp || opts.unprivileged) { ip_pkt = 0; pkt = (icmp_echo_packet_t*)buf; pt_pkt = (ping_tunnel_pkt_t*)pkt->data; @@ -326,7 +326,7 @@ void handle_data(icmp_echo_packet_t *pkt, int total_len, forward_desc_t *ring[], */ expected_len += pt_pkt->data_len; expected_len += expected_len % 2; - if (opts.udp) + if (opts.udp || opts.unprivileged) expected_len -= sizeof(ip_packet_t); if (total_len < expected_len) { pt_log(kLog_error, "Packet not completely received: %d Should be: %d. " |