Permalink
Browse files

Updates for `tcpkill_kill()` to support 32-bit values for `kill_count`

  • Loading branch information...
jpiccari committed Sep 14, 2015
1 parent 33e7076 commit 6236440b6f6cfc10a53dfe3aa30c61f16f1bb5c4
Showing with 5 additions and 6 deletions.
  1. +2 −2 ngrep.c
  2. +2 −3 tcpkill.c
  3. +1 −1 tcpkill.h
View
@@ -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':
View
@@ -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;
View
@@ -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.