diff --git a/ngrep.c b/ngrep.c index c2a8aa9..ff676a4 100644 --- a/ngrep.c +++ b/ngrep.c @@ -108,7 +108,7 @@ uint32_t snaplen = 65535, limitlen = 65535, promisc = 1, to = 100; uint32_t match_after = 0, keep_matching = 0, matches = 0, max_matches = 0; #if USE_TCPKILL -uint16_t tcpkill_active = 0; +uint32_t tcpkill_active = 0; #endif uint8_t re_match_word = 0, re_ignore_case = 0, re_multiline_match = 1; @@ -337,7 +337,7 @@ int main(int argc, char **argv) { break; #if USE_TCPKILL case 'K': - tcpkill_active = atoi(optarg); + tcpkill_active = _atoui32(optarg); break; #endif case 'h': diff --git a/tcpkill.c b/tcpkill.c index 2363224..5388ec5 100644 --- a/tcpkill.c +++ b/tcpkill.c @@ -23,13 +23,12 @@ libnet_t *l; void tcpkill_kill(const struct pcap_pkthdr *pcap, const u_char *pkt, - unsigned pcap_off, unsigned kill_count) + uint32_t pcap_off, uint32_t kill_count) { struct libnet_ipv4_hdr *ip; struct libnet_tcp_hdr *tcp; u_char ctext[64]; - u_int32_t seq, win; - int i, len; + uint32_t seq, win, i, len; pkt += pcap_off; len = pcap->caplen - pcap_off; diff --git a/tcpkill.h b/tcpkill.h index 32328dd..497ab2f 100644 --- a/tcpkill.h +++ b/tcpkill.h @@ -2,6 +2,6 @@ #define TCPKILL_H void tcpkill_init(void); -void tcpkill_kill(const struct pcap_pkthdr *pcap, const u_char *pkt, unsigned pcap_off, unsigned kill_count); +void tcpkill_kill(const struct pcap_pkthdr *pcap, const u_char *pkt, uint32_t pcap_off, uint32_t kill_count); #endif