aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2019-07-04 19:42:07 +0200
committerToni Uhlig <matzeton@googlemail.com>2019-07-04 19:42:07 +0200
commitd0c9e04d128e1696dcff089978cf823e0316389e (patch)
tree6e6dbb5a3b3b409edf8be4dc5ca68381891c58c0
parent8b264b41e57dc9776279f7a88f9792a15e0f211a (diff)
handle_extended_options should use proxy_desc_t* instead of a incomplete void* as 1st argument
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
-rw-r--r--src/pkt.c9
-rw-r--r--src/pkt.h3
2 files changed, 6 insertions, 6 deletions
diff --git a/src/pkt.c b/src/pkt.c
index 44af20d..c8eeba2 100644
--- a/src/pkt.c
+++ b/src/pkt.c
@@ -176,9 +176,9 @@ void handle_packet(char *buf, unsigned bytes, int is_pcap, struct sockaddr_in *a
init_state = kProto_data;
cur = (proxy_desc_t *) create_and_insert_proxy_desc(pt_pkt->id_no, pkt->identifier, 0,
- addr, pt_pkt->dst_ip,
- ntohl(pt_pkt->dst_port),
- init_state, kProxy_flag);
+ addr, pt_pkt->dst_ip,
+ ntohl(pt_pkt->dst_port),
+ init_state, kProxy_flag);
if (!cur) {
/* if failed, abort. Logging is done in create_insert_proxy_desc */
pt_log(kLog_error, "Failed to create proxy descriptor!\n");
@@ -432,9 +432,8 @@ void handle_data(icmp_echo_packet_t *pkt, int total_len, forward_desc_t *ring[],
}
}
-void handle_extended_options(void *vcur)
+void handle_extended_options(proxy_desc_t *cur)
{
- proxy_desc_t *cur = (proxy_desc_t *)vcur;
if (cur->extended_options[0] > 0) {
if (cur->extended_options[0] > cur->window_size) {
size_t extend = cur->extended_options[0] - cur->window_size;
diff --git a/src/pkt.h b/src/pkt.h
index 8002f78..3953adb 100644
--- a/src/pkt.h
+++ b/src/pkt.h
@@ -133,6 +133,7 @@ typedef struct {
typedef struct forward_desc_t forward_desc_t;
typedef struct icmp_desc_t icmp_desc_t;
+typedef struct proxy_desc_t proxy_desc_t;
void handle_packet(char *buf, unsigned bytes, int is_pcap, struct sockaddr_in *addr, int icmp_sock);
@@ -140,7 +141,7 @@ void handle_packet(char *buf, unsigned bytes, int is_pcap, struct sockaddr_in *a
void handle_data(icmp_echo_packet_t *pkt, int total_len, forward_desc_t **ring,
int *await_send, int *insert_idx, uint16_t *next_expected_seq, void *vcur, uint16_t window_size);
-void handle_extended_options(void *vcur);
+void handle_extended_options(proxy_desc_t *cur);
void handle_ack(uint16_t seq_no, icmp_desc_t *ring, int *packets_awaiting_ack,
int one_ack_only, int insert_idx, int *first_ack,