Skip to content

Commit

Permalink
Updates for tcpkill_kill() to support 32-bit values for kill_count
Browse files Browse the repository at this point in the history
  • Loading branch information
jpiccari committed Sep 14, 2015
1 parent 33e7076 commit 6236440
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions ngrep.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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':
Expand Down
5 changes: 2 additions & 3 deletions tcpkill.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion tcpkill.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 6236440

Please sign in to comment.