From 79ab49285ecf23a7b1e5179e5b4cd59ee58bb282 Mon Sep 17 00:00:00 2001
From: Toni Uhlig <matzeton@googlemail.com>
Date: Thu, 5 Dec 2019 19:28:23 +0100
Subject: removed superfluous explicit numeric casts

Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
---
 src/pkt.c     | 7 ++++---
 src/pkt.h     | 2 +-
 src/ptunnel.c | 2 +-
 3 files changed, 6 insertions(+), 5 deletions(-)

(limited to 'src')

diff --git a/src/pkt.c b/src/pkt.c
index 11570f0..5f6583b 100644
--- a/src/pkt.c
+++ b/src/pkt.c
@@ -122,8 +122,9 @@ void handle_packet(char *buf, unsigned bytes, int is_pcap, struct sockaddr_in *a
 				if (!is_pcap)
 					cur->xfer.icmp_in++;
 			}
-			else
+			else {
 				type_flag           = kProxy_flag;
+			}
   
 			pkt_flag        = pt_pkt->state & kFlag_mask;
 			pt_pkt->state   &= ~kFlag_mask;
@@ -315,7 +316,7 @@ void handle_packet(char *buf, unsigned bytes, int is_pcap, struct sockaddr_in *a
 						}
 						handle_data(pkt, bytes, cur, 0);
 					}
-					handle_ack((uint16_t)pt_pkt->ack, cur);
+					handle_ack(pt_pkt->ack, cur);
 					cur->last_activity = now;
 				}
 			}
@@ -462,7 +463,7 @@ void handle_extended_options(proxy_desc_t *cur)
 	}
 }
 
-void handle_ack(uint16_t seq_no, proxy_desc_t *cur)
+void handle_ack(uint32_t seq_no, proxy_desc_t *cur)
 {
 	if (cur->send_wait_ack > 0) {
 		int	i, can_ack = 0, count = 0;
diff --git a/src/pkt.h b/src/pkt.h
index c400aed..1c59932 100644
--- a/src/pkt.h
+++ b/src/pkt.h
@@ -142,6 +142,6 @@ void handle_data(icmp_echo_packet_t *pkt, int total_len, proxy_desc_t *cur, int
 
 void handle_extended_options(proxy_desc_t *cur);
 
-void handle_ack(uint16_t seq_no, proxy_desc_t *cur);
+void handle_ack(uint32_t seq_no, proxy_desc_t *cur);
 
 #endif
diff --git a/src/ptunnel.c b/src/ptunnel.c
index dde63d3..a8c0a40 100644
--- a/src/ptunnel.c
+++ b/src/ptunnel.c
@@ -385,7 +385,7 @@ void pt_forwarder(void) {
 				}
 			}
 			addr	= dest_addr;
-			rand_id	= (uint16_t) pt_random();
+			rand_id	= pt_random();
 			create_and_insert_proxy_desc(rand_id, rand_id, new_sock, &addr, opts.given_dst_ip, opts.given_dst_port, kProxy_start, kUser_flag);
 			pthread_mutex_unlock(&num_threads_lock);
 		}
-- 
cgit v1.2.3