diff --git a/Makefile b/Makefile index f65e7d8..847118e 100644 --- a/Makefile +++ b/Makefile @@ -17,6 +17,7 @@ CFLAGS += -I/usr/include/pcap # directories: #LDFLAGS += -L/usr/local/lib # LDFLAGS += -pg -a +LDFLAGS += -pthread # PREFIX specifies the base directory for the installation. PREFIX = /usr/local @@ -30,10 +31,10 @@ MANDIR = man #MANDIR = share/man # FHS-ish # You shouldn't need to change anything below this point. -VERSION = 0.9pre3 +VERSION = 0.9pre4 CFLAGS += -g -Wall "-DIFTOP_VERSION=\"$(VERSION)\"" LDFLAGS += -g -LDLIBS += -lpcap -lpthread -lcurses -lm +LDLIBS += -lpcap -lcurses -lm SRCS = iftop.c addr_hash.c hash.c ns_hash.c resolver.c ui.c util.c sorted_list.c\ options.c serv_hash.c threadprof.c diff --git a/iftop.c b/iftop.c index 03e857d..b2c45b6 100644 --- a/iftop.c +++ b/iftop.c @@ -134,7 +134,7 @@ void assign_addr_pair(addr_pair* ap, struct ip* iptr, int flip) { unsigned short int dst_port = 0; /* Does this protocol use ports? */ - if(iptr->ip_p == IPPROTO_TCP || IP_HL(iptr) == IPPROTO_UDP) { + if(iptr->ip_p == IPPROTO_TCP || iptr->ip_p == IPPROTO_UDP) { /* We take a slight liberty here by treating UDP the same as TCP */ /* Find the TCP/UDP header */ diff --git a/iftop.h b/iftop.h index 0d01fee..cad1d95 100644 --- a/iftop.h +++ b/iftop.h @@ -35,7 +35,7 @@ void options_read(int argc, char **argv); /* Make use of SIOCGIFHWADDR work on FreeBSD */ -#ifdef __BSD__ +#ifndef SIOCGIFHWADDR #define SIOCGIFHWADDR SIOCGIFADDR #define ifr_hwaddr ifr_addr #endif diff --git a/ns_hash.c b/ns_hash.c index 74e1744..3a1d463 100644 --- a/ns_hash.c +++ b/ns_hash.c @@ -2,7 +2,9 @@ #include #include +#include #include +#include #include #include #include "ns_hash.h" diff --git a/ns_hash.h b/ns_hash.h index be644cd..78814be 100644 --- a/ns_hash.h +++ b/ns_hash.h @@ -8,6 +8,7 @@ #ifndef __NS_HASH_H_ /* include guard */ #define __NS_HASH_H_ +#include #include #include #include diff --git a/resolver.c b/resolver.c index e98cbf0..8602421 100644 --- a/resolver.c +++ b/resolver.c @@ -3,8 +3,9 @@ * */ -#include +#include #include +#include #include #include #include diff --git a/resolver.h b/resolver.h index efad57c..836fe25 100644 --- a/resolver.h +++ b/resolver.h @@ -6,8 +6,12 @@ #ifndef __RESOLVER_H_ /* include guard */ #define __RESOLVER_H_ +#include +#include +#include #include + void resolver_initialise(); void resolve(struct in_addr* addr, char* result, int buflen); diff --git a/serv_hash.h b/serv_hash.h index 6241134..2d9ecde 100644 --- a/serv_hash.h +++ b/serv_hash.h @@ -6,6 +6,7 @@ #ifndef __SERV_HASH_H_ /* include guard */ #define __SERV_HASH_H_ +#include #include #include #include