# Compile error for dsniff



## oobayly (Apr 8, 2010)

I'm trying to install the dsniff port on FreeBSD 7.2-RELEASE and get the following compile error:

```
# make
===>  Found saved configuration for dsniff-2.3_4
===>  Extracting for dsniff-2.3_4
=> MD5 Checksum OK for dsniff-2.3.tar.gz.
=> SHA256 Checksum OK for dsniff-2.3.tar.gz.
===>  Patching for dsniff-2.3_4
===>  Applying FreeBSD patches for dsniff-2.3_4
===>   dsniff-2.3_4 depends on file: /usr/local/bin/libnet10-config - found
===>   dsniff-2.3_4 depends on file: /usr/local/lib/libnids.a - found
===>   dsniff-2.3_4 depends on executable: pkg-config - found
===>   dsniff-2.3_4 depends on shared library: glib-2.0.0 - found
===>  Configuring for dsniff-2.3_4
creating cache ./config.cache
checking for gcc... cc
checking whether the C compiler (cc -O2 -fno-strict-aliasing -pipe ) works... yes
checking whether the C compiler (cc -O2 -fno-strict-aliasing -pipe ) is a cross-compiler... no
checking whether we are using GNU C... yes
checking whether cc accepts -g... yes
checking for a BSD compatible install... /usr/bin/install -c -o root -g wheel
checking for ranlib... ranlib
checking how to run the C preprocessor... cc -E
checking for X... disabled
checking for ANSI C header files... yes
checking for err.h... yes
checking for fcntl.h... yes
checking for sys/ioctl.h... yes
checking for sys/queue.h... yes
checking for unistd.h... yes
checking for libgen.h... yes
checking for net/if_tun.h... yes
checking for MIN and MAX in sys/param.h... yes
checking for working const... yes
checking for size_t... yes
checking whether struct tm is in sys/time.h or time.h... time.h
checking for u_int32_t... yes
checking for u_int64_t... yes
checking for in_addr_t... yes
checking whether cc needs -traditional... no
checking for 8-bit clean memcmp... yes
checking return type of signal handlers... void
checking for strftime... yes
checking for gethostname... yes
checking for socket... yes
checking for strdup... yes
checking for strstr... yes
checking for xdr_fhstatus in -lrpcsvc... yes
checking for socket in -lsocket... no
checking for gethostbyname in -lnsl... no
checking for dn_expand in -lresolv... no
checking for dirname... yes
checking for strlcpy... yes
checking for strlcat... yes
checking for strsep... yes
checking for MD5Update... no
checking for warnx... yes
checking for ether_ntoa... yes
checking for Berkeley DB with 1.85 compatibility... yes
checking for libpcap... yes
checking for libnet... yes
checking for libnids... yes
checking whether libnids version is good... yes
checking for OpenSSL... yes
updating cache ./config.cache
creating ./config.status
creating Makefile
creating config.h
===>  Building for dsniff-2.3_4
cc -O2 -fno-strict-aliasing -pipe -D_BSD_SOURCE -DLIBNET_BSDISH_OS -DLIBNET_BSD_BYTE_SWAP -DHAVE_SOCKADDR_SA_LEN -DLIBNET_LIL_ENDIAN 
-DDSNIFF_LIBDIR=\"/usr/local/lib/\" -I. -I/usr/local/include -I/usr/local/include -I/usr/local/include/libnet10     -I./missing -c ./missing
/dummy.c
cc -O2 -fno-strict-aliasing -pipe -D_BSD_SOURCE -DLIBNET_BSDISH_OS -DLIBNET_BSD_BYTE_SWAP -DHAVE_SOCKADDR_SA_LEN -DLIBNET_LIL_ENDIAN 
-DDSNIFF_LIBDIR=\"/usr/local/lib/\" -I. -I/usr/local/include -I/usr/local/include -I/usr/local/include/libnet10     -I./missing -c ./missing
/md5.c
ar -cr libmissing.a dummy.o  md5.o
ranlib libmissing.a
cc -O2 -fno-strict-aliasing -pipe -D_BSD_SOURCE -DLIBNET_BSDISH_OS -DLIBNET_BSD_BYTE_SWAP -DHAVE_SOCKADDR_SA_LEN -DLIBNET_LIL_ENDIAN 
-DDSNIFF_LIBDIR=\"/usr/local/lib/\" -I. -I/usr/local/include -I/usr/local/include -I/usr/local/include/libnet10     -I./missing -c ./arpspoof.c
cc -O2 -fno-strict-aliasing -pipe -D_BSD_SOURCE -DLIBNET_BSDISH_OS -DLIBNET_BSD_BYTE_SWAP -DHAVE_SOCKADDR_SA_LEN -DLIBNET_LIL_ENDIAN 
-DDSNIFF_LIBDIR=\"/usr/local/lib/\" -I. -I/usr/local/include -I/usr/local/include -I/usr/local/include/libnet10     -I./missing -c ./arp.c
./arp.c: In function 'arp_cache_lookup':
./arp.c:74: warning: incompatible implicit declaration of built-in function 'memcpy'
cc  -o arpspoof arpspoof.o arp.o -lrpcsvc  -L. -lmissing -L/usr/local/lib -lpcap -L/usr/local/lib/libnet10 -lnet
cc -O2 -fno-strict-aliasing -pipe -D_BSD_SOURCE -DLIBNET_BSDISH_OS -DLIBNET_BSD_BYTE_SWAP -DHAVE_SOCKADDR_SA_LEN -DLIBNET_LIL_ENDIAN 
-DDSNIFF_LIBDIR=\"/usr/local/lib/\" -I. -I/usr/local/include -I/usr/local/include -I/usr/local/include/libnet10     -I./missing -c ./dnsspoof.c
cc -O2 -fno-strict-aliasing -pipe -D_BSD_SOURCE -DLIBNET_BSDISH_OS -DLIBNET_BSD_BYTE_SWAP -DHAVE_SOCKADDR_SA_LEN -DLIBNET_LIL_ENDIAN 
-DDSNIFF_LIBDIR=\"/usr/local/lib/\" -I. -I/usr/local/include -I/usr/local/include -I/usr/local/include/libnet10     -I./missing -c ./pcaputil.c
In file included from /usr/local/include/pcap.h:45,
                 from /usr/include/pcap-int.h:44,
                 from ./pcaputil.c:18:
/usr/local/include/pcap/pcap.h:81: error: redefinition of typedef 'pcap_t'
/usr/include/pcap.h:66: error: previous declaration of 'pcap_t' was here
/usr/local/include/pcap/pcap.h:82: error: redefinition of typedef 'pcap_dumper_t'
/usr/include/pcap.h:67: error: previous declaration of 'pcap_dumper_t' was here
/usr/local/include/pcap/pcap.h:83: error: redefinition of typedef 'pcap_if_t'
/usr/include/pcap.h:68: error: previous declaration of 'pcap_if_t' was here
/usr/local/include/pcap/pcap.h:84: error: redefinition of typedef 'pcap_addr_t'
/usr/include/pcap.h:69: error: previous declaration of 'pcap_addr_t' was here
/usr/local/include/pcap/pcap.h:123: error: redefinition of 'struct pcap_file_header'
/usr/local/include/pcap/pcap.h:144: error: redeclaration of enumerator 'PCAP_D_INOUT'
/usr/include/pcap.h:116: error: previous definition of 'PCAP_D_INOUT' was here
/usr/local/include/pcap/pcap.h:145: error: redeclaration of enumerator 'PCAP_D_IN'
/usr/include/pcap.h:117: error: previous definition of 'PCAP_D_IN' was here
/usr/local/include/pcap/pcap.h:147: error: redeclaration of enumerator 'PCAP_D_OUT'
/usr/include/pcap.h:119: error: previous definition of 'PCAP_D_OUT' was here
/usr/local/include/pcap/pcap.h:147: error: conflicting types for 'pcap_direction_t'
/usr/include/pcap.h:119: error: previous declaration of 'pcap_direction_t' was here
/usr/local/include/pcap/pcap.h:161: error: redefinition of 'struct pcap_pkthdr'
/usr/local/include/pcap/pcap.h:170: error: redefinition of 'struct pcap_stat'
/usr/local/include/pcap/pcap.h:215: error: redefinition of 'struct pcap_if'
/usr/local/include/pcap/pcap.h:228: error: redefinition of 'struct pcap_addr'
/usr/local/include/pcap/pcap.h:237: error: redefinition of typedef 'pcap_handler'
/usr/include/pcap.h:209: error: previous declaration of 'pcap_handler' was here
/usr/local/include/pcap/pcap.h:305: error: conflicting types for 'pcap_setdirection'
/usr/include/pcap.h:226: error: previous declaration of 'pcap_setdirection' was here
/usr/local/include/pcap/pcap.h:352: error: conflicting types for 'bpf_filter'
/usr/include/pcap.h:268: error: previous declaration of 'bpf_filter' was here
/usr/local/include/pcap/pcap.h:353: error: conflicting types for 'bpf_validate'
/usr/include/pcap.h:269: error: previous declaration of 'bpf_validate' was here
/usr/local/include/pcap/pcap.h:354: error: conflicting types for 'bpf_image'
/usr/include/pcap.h:270: error: previous declaration of 'bpf_image' was here
/usr/local/include/pcap/pcap.h:355: error: conflicting types for 'bpf_dump'
/usr/include/pcap.h:271: error: previous declaration of 'bpf_dump' was here
*** Error code 1

Stop in /usr/ports/security/dsniff/work/dsniff-2.3.
*** Error code 1

Stop in /usr/ports/security/dsniff.
*** Error code 1

Stop in /usr/ports/security/dsniff.
```

Any suggestions why I'd have two sets of pcap includes? Just thinking about it, I upgraded libpcap this morning from 1.0.0_1 to 1.1.1

Many thanks,
John


----------



## SirDice (Apr 8, 2010)

Remove libpcap and let dsniff use the one that's supplied with the base OS.


----------



## oobayly (Apr 8, 2010)

OK, but seeing as libpcap is needed by tcpdump, won't this cause issues if I remove tcpdump & libpcap, install dsniff and then reinstall tcpdump (along with libpcap)?


----------



## DutchDaemon (Apr 8, 2010)

tcpdump is a base-system utility, so it will use the base system's libpcap:


```
# ldd /usr/sbin/tcpdump
/usr/sbin/tcpdump:
        libpcap.so.7 => /lib/libpcap.so.7 (0x28118000)
        libcrypto.so.6 => /lib/libcrypto.so.6 (0x28145000)
        libc.so.7 => /lib/libc.so.7 (0x28297000)
```


----------



## oobayly (Apr 8, 2010)

And there I was thinking I needed the tcpdump port as it wasn't in the base system. Removed tcpdump & libpcap, installed dsniff and everything works fine.

Thanks.


----------

