1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
--- iptraf-3.0.0.orig/src/tcptable.c 2005-09-13 08:42:54.000000000 +0200
+++ iptraf-3.0.0/src/tcptable.c 2009-05-21 23:07:02.000000000 +0200
@@ -17,6 +17,7 @@ details.
***/
+#include <stdlib.h>
#include <winops.h>
#include "options.h"
#include "tcptable.h"
@@ -143,7 +144,7 @@ int add_tcp_hash_entry(struct tcptable *
entry->daddr.s_addr, entry->dport, entry->ifname);
ptmp = malloc(sizeof(struct tcp_hashentry));
- bzero(ptmp, sizeof(struct tcp_hashentry));
+ memset(ptmp, 0, sizeof(struct tcp_hashentry));
if (ptmp == NULL)
return 1;
@@ -337,8 +338,8 @@ struct tcptableent *addentry(struct tcpt
* Zero out MAC address fields
*/
- bzero(new_entry->smacaddr, 15);
- bzero(new_entry->oth_connection->smacaddr, 15);
+ memset(new_entry->smacaddr, 0, 15);
+ memset(new_entry->oth_connection->smacaddr, 0, 15);
/*
* Set raw port numbers
@@ -596,12 +597,10 @@ void updateentry(struct tcptable *table,
tableentry->spanbr += bcount;
if (opts->mac) {
- bzero(newmacaddr, 15);
+ memset(newmacaddr, 0, 15);
if ((linkproto == LINK_ETHERNET) || (linkproto == LINK_PLIP)) {
convmacaddr(((struct ethhdr *) packet)->h_source, newmacaddr);
- } else if (linkproto == LINK_FDDI) {
- convmacaddr(((struct fddihdr *) packet)->saddr, newmacaddr);
} else if (linkproto == LINK_TR) {
convmacaddr(((struct trh_hdr *) packet)->saddr, newmacaddr);
}
|