Skip to content

Commit 6236440

Browse files
committed
Updates for tcpkill_kill() to support 32-bit values for kill_count
1 parent 33e7076 commit 6236440

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

ngrep.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ uint32_t snaplen = 65535, limitlen = 65535, promisc = 1, to = 100;
108108
uint32_t match_after = 0, keep_matching = 0, matches = 0, max_matches = 0;
109109

110110
#if USE_TCPKILL
111-
uint16_t tcpkill_active = 0;
111+
uint32_t tcpkill_active = 0;
112112
#endif
113113

114114
uint8_t re_match_word = 0, re_ignore_case = 0, re_multiline_match = 1;
@@ -337,7 +337,7 @@ int main(int argc, char **argv) {
337337
break;
338338
#if USE_TCPKILL
339339
case 'K':
340-
tcpkill_active = atoi(optarg);
340+
tcpkill_active = _atoui32(optarg);
341341
break;
342342
#endif
343343
case 'h':

tcpkill.c

+2-3
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,12 @@ libnet_t *l;
2323

2424
void
2525
tcpkill_kill(const struct pcap_pkthdr *pcap, const u_char *pkt,
26-
unsigned pcap_off, unsigned kill_count)
26+
uint32_t pcap_off, uint32_t kill_count)
2727
{
2828
struct libnet_ipv4_hdr *ip;
2929
struct libnet_tcp_hdr *tcp;
3030
u_char ctext[64];
31-
u_int32_t seq, win;
32-
int i, len;
31+
uint32_t seq, win, i, len;
3332

3433
pkt += pcap_off;
3534
len = pcap->caplen - pcap_off;

tcpkill.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
#define TCPKILL_H
33

44
void tcpkill_init(void);
5-
void tcpkill_kill(const struct pcap_pkthdr *pcap, const u_char *pkt, unsigned pcap_off, unsigned kill_count);
5+
void tcpkill_kill(const struct pcap_pkthdr *pcap, const u_char *pkt, uint32_t pcap_off, uint32_t kill_count);
66

77
#endif

0 commit comments

Comments
 (0)