Description: <short summary of the patch>
 TODO: Put a short summary on the line above and replace this paragraph
 with a longer explanation of this change. Complete the meta-information
 with other relevant fields (see below for details). To make it easier, the
 information below has been extracted from the changelog. Adjust it or drop
 it.
 .
 ettercap (1:0.8.0-11) unstable; urgency=medium
 .
   * Removing ethtool as b-d for non linux kernels.
Author: Gianfranco Costamagna <costamagnagianfranco@yahoo.it>

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: http://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: <YYYY-MM-DD>

--- ettercap-0.8.0.orig/CMakeLists.txt
+++ ettercap-0.8.0/CMakeLists.txt
@@ -19,7 +19,7 @@ option(LIBRARY_BUILD "Build for libetter
 option(INSTALL_DESKTOP "Install ettercap desktop files" ON)
 
 
-SET(VALID_BUILD_TYPES Debug Release)
+SET(VALID_BUILD_TYPES Debug Release RelWithDebInfo)
 
 if(NOT CMAKE_BUILD_TYPE)
   # Default to using "Release" as our build type.
--- ettercap-0.8.0.orig/cmake/Modules/EttercapLibCheck.cmake
+++ ettercap-0.8.0/cmake/Modules/EttercapLibCheck.cmake
@@ -1,6 +1,7 @@
 ## The easy part
 
 set(EC_LIBS)
+set(EC_LIBETTERCAP_LIBS)
 set(EC_INCLUDE)
 
 set(EF_LIBS)
@@ -41,6 +42,7 @@ if(ENABLE_GTK)
 	find_library(FOUND_GTHREAD gthread-2.0)
     	if(FOUND_GTHREAD)
 		set(EC_LIBS ${EC_LIBS} ${FOUND_GTHREAD})
+		set(EC_LIBETTERCAP_LIBS ${EC_LIBETTERCAP_LIBS} ${FOUND_GTHREAD})
     	endif(FOUND_GTHREAD)
     else(OS_DARWIN)
         set(EC_LIBS ${EC_LIBS} gthread-2.0)
@@ -51,6 +53,7 @@ if(ENABLE_SSL)
     find_package(OpenSSL REQUIRED)
     set(HAVE_OPENSSL 1)
     set(EC_LIBS ${EC_LIBS} ${OPENSSL_LIBRARIES})
+    set(EC_LIBETTERCAP_LIBS ${EC_LIBETTERCAP_LIBS} ${OPENSSL_LIBRARIES})
     set(EC_INCLUDE ${EC_INCLUDE} ${OPENSSL_INCLUDE_DIR})
 else(ENABLE_SSL)
     set(HAVE_OPENSSL 0)
@@ -58,6 +61,7 @@ endif(ENABLE_SSL)
 
 find_package(ZLIB REQUIRED)
 set(EC_LIBS ${EC_LIBS} ${ZLIB_LIBRARIES})
+set(EC_LIBETTERCAP_LIBS ${EC_LIBETTERCAP_LIBS} ${ZLIB_LIBRARIES})
 set(EC_INCLUDE ${EC_INCLUDE} ${ZLIB_INCLUDE_DIRS})
 set(EL_LIBS ${EL_LIBS} ${ZLIB_LIBRARIES})
 
@@ -65,6 +69,7 @@ set(CMAKE_THREAD_PREFER_PTHREAD 1)
 find_package(Threads REQUIRED)
 if(CMAKE_USE_PTHREADS_INIT)
     set(EC_LIBS ${EC_LIBS} ${CMAKE_THREAD_LIBS_INIT})
+    set(EC_LIBETTERCAP_LIBS ${EC_LIBETTERCAP_LIBS} ${CMAKE_THREAD_LIBS_INIT})
     set(EF_LIBS ${EF_LIBS} ${CMAKE_THREAD_LIBS_INIT})
     set(EL_LIBS ${EL_LIBS} ${CMAKE_THREAD_LIBS_INIT})
 else(CMAKE_USE_PTHREADS_INIT)
@@ -84,6 +89,8 @@ if(NOT HAVE_UTF8)
     if(HAVE_ICONV)
         set(HAVE_UTF8 1)
         set(EC_LIBS ${EC_LIBS} ${HAVE_ICONV})
+# Not needed the next one?
+        set(EC_LIBETTERCAP_LIBS ${EC_LIBETTERCAP_LIBS} ${HAVE_ICONV})
         set(EL_LIBS ${EL_LIBS} ${HAVE_ICONV})
     endif(HAVE_ICONV)
 endif(NOT HAVE_UTF8)
@@ -104,6 +111,7 @@ if(ENABLE_PLUGINS)
         if(HAVE_DL)
             set(HAVE_PLUGINS 1)
             set(EC_LIBS ${EC_LIBS} ${HAVE_DL})
+            set(EC_LIBETTERCAP_LIBS ${EC_LIBETTERCAP_LIBS} ${HAVE_DL})
         endif(HAVE_DL)
     endif(HAVE_DLOPEN)
 endif(ENABLE_PLUGINS)
@@ -151,6 +159,7 @@ CHECK_FUNCTION_EXISTS(strndup HAVE_STRND
 find_library(HAVE_PCAP pcap)
 if(HAVE_PCAP)
     set(EC_LIBS ${EC_LIBS} ${HAVE_PCAP})
+    set(EC_LIBETTERCAP_LIBS ${EC_LIBETTERCAP_LIBS} ${HAVE_PCAP})
 else(HAVE_PCAP)
     message(FATAL_ERROR "libpcap not found!")
 endif(HAVE_PCAP)
@@ -190,12 +199,13 @@ endif(NOT LIBNET_FOUND)
 
 include_directories(${LIBNET_INCLUDE_DIR})
 set(EC_LIBS ${EC_LIBS} ${LIBNET_LIBRARY})
-
+set(EC_LIBETTERCAP_LIBS ${EC_LIBETTERCAP_LIBS} ${LIBNET_LIBRARY})
 # end LIBNET 
 
 find_library(HAVE_RESOLV resolv)
 if(HAVE_RESOLV)
 	set(EC_LIBS ${EC_LIBS} ${HAVE_RESOLV})
+        set(EC_LIBETTERCAP_LIBS ${EC_LIBETTERCAP_LIBS} ${HAVE_RESOLV})
 	set(HAVE_DN_EXPAND 1 CACHE PATH "Found dn_expand")
 endif(HAVE_RESOLV)
 
@@ -204,5 +214,6 @@ if(PCRE_LIBRARY)
     set(HAVE_PCRE 1)
     include_directories(${PCRE_INCLUDE_DIR})
     set(EC_LIBS ${EC_LIBS} ${PCRE_LIBRARY})
+    set(EC_LIBETTERCAP_LIBS ${EC_LIBETTERCAP_LIBS} ${PCRE_LIBRARY})
     set(EF_LIBS ${EF_LIBS} ${PCRE_LIBRARY})
 endif(PCRE_LIBRARY)
--- ettercap-0.8.0.orig/cmake/Modules/EttercapOSTest.cmake
+++ ettercap-0.8.0/cmake/Modules/EttercapOSTest.cmake
@@ -1,3 +1,4 @@
+message("Building ${PROJECT_NAME} for detected system: ${CMAKE_SYSTEM_NAME}")
 if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
     set(OS_LINUX 1)
 elseif(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
@@ -13,6 +14,8 @@ elseif(${CMAKE_SYSTEM_NAME} MATCHES "Dar
     set(OS_DARWIN 1)
 elseif(${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
     set(OS_SOLARIS 1)
+elseif(${CMAKE_SYSTEM_NAME} MATCHES "GNU")
+    set(OS_GNU 1)
 elseif(MINGW)
     set(OS_MINGW 1)
     set(OS_WINDOWS 1)
--- ettercap-0.8.0.orig/include/config.h.cmake
+++ ettercap-0.8.0/include/config.h.cmake
@@ -6,6 +6,7 @@
 #cmakedefine OS_BSD_NET
 #cmakedefine OS_BSD_OPEN
 #cmakedefine OS_DARWIN
+#cmakedefine OS_GNU
 
 #cmakedefine WORDS_BIGENDIAN
 #cmakedefine OS_SIZEOF_P @OS_SIZEOF_P@
--- ettercap-0.8.0.orig/include/ec.h
+++ ettercap-0.8.0/include/ec.h
@@ -16,6 +16,10 @@
    #include <windows.h>
 #endif
 
+#ifndef PATH_MAX
+   #define PATH_MAX  1024
+#endif
+
 #if !defined (__USE_GNU)   /* for memmem(), strsignal(), etc etc... */
    #define __USE_GNU
 #endif
@@ -172,6 +176,9 @@
 /* exported by ec_main */
 EC_API_EXTERN void clean_exit(int errcode);
 
+/* exported by ec_mem */
+EC_API_EXTERN void safe_free_mem(char **param, int *param_length, char *command);
+
 
 #endif   /*  EC_H */
 
--- ettercap-0.8.0.orig/include/ef_functions.h
+++ ettercap-0.8.0/include/ef_functions.h
@@ -25,7 +25,7 @@ EF_API_EXTERN void test_filter(char *fil
 EF_API_EXTERN void print_fop(struct filter_op *fop, u_int32 eip);
 
 /* ef_syntax && ef_grammar */
-EF_API_EXTERN int yyerror(char *);                                                                         
+EF_API_EXTERN int yyerror(const char *);                                                                         
 EF_API_EXTERN int yylex(void);
 
 /* ef_tables */
--- ettercap-0.8.0.orig/src/CMakeLists.txt
+++ ettercap-0.8.0/src/CMakeLists.txt
@@ -1,4 +1,5 @@
 set(EC_SRC
+	ec_mem.c
         ec_capture.c
         ec_checksum.c
         ec_conf.c
@@ -115,9 +116,6 @@ set(EC_SRC
         protocols/ec_wifi_radiotap.c
 )
 
-if (NOT LIBRARY_BUILD)
-	set(EC_SRC ${EC_SRC} ec_interfaces.c)
-endif(NOT LIBRARY_BUILD)
 
 if(ENABLE_IPV6)
     set(EC_SRC ${EC_SRC} protocols/ec_icmp6.c protocols/ec_ip6.c mitm/ec_ip6nd_poison.c)
@@ -142,6 +140,8 @@ elseif(OS_MINGW)
     set(EC_SRC ${EC_SRC} os/ec_mingw.c)
 elseif(OS_SOLARIS)
     set(EC_SRC ${EC_SRC} os/ec_solaris.c)
+elseif(OS_GNU)
+    set(EC_SRC ${EC_SRC} os/ec_gnu.c)
 endif()
 
 if(NOT HAVE_STRLCAT)
@@ -173,10 +173,8 @@ endif(NOT LIBRARY_BUILD)
 
 add_library(lib_ettercap SHARED ${EC_SRC})
 add_dependencies(lib_ettercap libnet)
+target_link_libraries(lib_ettercap ${EC_LIBETTERCAP_LIBS})
 
-if (NOT LIBRARY_BUILD)
-	add_executable(ettercap ec_main.c)
-endif(NOT LIBRARY_BUILD)
 
 # Only compile lua stuff if lua is enabled!
 IF(ENABLE_LUA)
@@ -194,21 +192,24 @@ IF(ENABLE_LUA)
   endif()
 endif(ENABLE_LUA)
 
-if(NOT LIBRARY_BUILD)
-	target_link_libraries(lib_ettercap ec_interfaces ${EC_LIBS})
-else(NOT LIBRARY_BUILD)
-	target_link_libraries(lib_ettercap ${EC_LIBS})
-endif(NOT LIBRARY_BUILD)
+#if(NOT LIBRARY_BUILD)
+	#target_link_libraries(lib_ettercap ec_interfaces ${EC_LIBS})
+#else(NOT LIBRARY_BUILD)
+	#target_link_libraries(lib_ettercap ${EC_LIBS})
+#endif(NOT LIBRARY_BUILD)
 
 set_target_properties(lib_ettercap PROPERTIES 
   ENABLE_EXPORTS On
   LINK_INTERFACE_LIBRARIES ""
   #  INSTALL_RPATH ${INSTALL_LIBDIR}
   OUTPUT_NAME ettercap
+  VERSION 0.0.1
+  SOVERSION 0
   )
 
 if (NOT LIBRARY_BUILD)
-	target_link_libraries(ettercap lib_ettercap)
+	add_executable(ettercap ec_interfaces.c ec_main.c)
+	target_link_libraries(ettercap ec_interfaces lib_ettercap)
 	set_target_properties(ettercap PROPERTIES 
   	INSTALL_RPATH ${INSTALL_LIBDIR}
   	)
--- ettercap-0.8.0.orig/src/ec_encryption.c
+++ ettercap-0.8.0/src/ec_encryption.c
@@ -205,14 +205,14 @@ int set_wep_key(char *string)
 
    /* sanity check */
    if (bit <= 0)
-      SEMIFATAL_ERROR("Unsupported WEP key lenght");
+      SEMIFATAL_ERROR("Unsupported WEP key length");
 
    /* the len of the secret part of the RC4 seed */
    tmp_wkey_len = bit / 8 - WEP_IV_LEN;
 
    /* sanity check */
    if (bit != 64 && bit != 128)
-	  SEMIFATAL_ERROR("Unsupported WEP key lenght");
+	  SEMIFATAL_ERROR("Unsupported WEP key length");
 
    /* get the type of the key */
    p = ec_strtok(NULL, ":", &tok);
@@ -227,7 +227,7 @@ int set_wep_key(char *string)
 	  SEMIFATAL_ERROR("Invalid parsing of the WEP key");
 
    if (type == 's') {
-      /* escape the string and check its lenght */
+      /* escape the string and check its length */
       if (strescape((char *)tmp_wkey, p) != (int)tmp_wkey_len)
     	  SEMIFATAL_ERROR("Specified WEP key length does not match the given string");
    } else if (type == 'p') {
--- ettercap-0.8.0.orig/src/ec_encryption_ccmp.c
+++ ettercap-0.8.0/src/ec_encryption_ccmp.c
@@ -43,9 +43,9 @@
 
 int wpa_ccmp_decrypt(u_char *mac, u_char *data, size_t len, struct wpa_sa sa);
 static inline void get_PN(u_char *PN, u_char *data);
-static inline void get_B0(u_char *B0, u_char *mac, u_char *PN, size_t len);
-static inline void get_AAD(u_char *AAD, u_char *mac, u_char *B0);
-static int ccmp_decrypt(u_char *enc, u_char *B0, u_char *B, u_char *A, u_char *mic, size_t len, AES_KEY *ctx);
+static inline void get_BZERO(u_char *BZERO, u_char *mac, u_char *PN, size_t len);
+static inline void get_AAD(u_char *AAD, u_char *mac, u_char *BZERO);
+static int ccmp_decrypt(u_char *enc, u_char *BZERO, u_char *B, u_char *A, u_char *mic, size_t len, AES_KEY *ctx);
 
 /*******************************************/
 
@@ -58,7 +58,7 @@ int wpa_ccmp_decrypt(u_char *mac, u_char
    u_char PN[6]; /* 48 bit Packet Number */
    size_t data_len = len - sizeof(struct wpa_header);
    u_char AAD[AES_BLOCK_SIZE*2];
-   u_char B0[AES_BLOCK_SIZE], A[AES_BLOCK_SIZE], B[AES_BLOCK_SIZE];
+   u_char BZERO[AES_BLOCK_SIZE], A[AES_BLOCK_SIZE], B[AES_BLOCK_SIZE];
    u_char decbuf[len];
    AES_KEY aes_ctx;
 
@@ -72,24 +72,24 @@ int wpa_ccmp_decrypt(u_char *mac, u_char
    /* get the Packet Number */
    get_PN(PN, data);
 
-   /* get the B0 */
-   memset(B0, 0, sizeof(B0));
-   get_B0(B0, mac, PN, data_len);
+   /* get the BZERO */
+   memset(BZERO, 0, sizeof(BZERO));
+   get_BZERO(BZERO, mac, PN, data_len);
 
    /* get the Additional Authentication Data */
    memset(AAD, 0, sizeof(AAD));
-   get_AAD(AAD, mac, B0);
+   get_AAD(AAD, mac, BZERO);
 
    /* Start with the first block and AAD */
-   AES_encrypt(B0, A, &aes_ctx);
+   AES_encrypt(BZERO, A, &aes_ctx);
    XOR_BLOCK(A, AAD, AES_BLOCK_SIZE);
    AES_encrypt(A, A, &aes_ctx);
    XOR_BLOCK(A, AAD + AES_BLOCK_SIZE, AES_BLOCK_SIZE);
    AES_encrypt(A, A, &aes_ctx);
 
-   B0[0] &= 0x07;
-   B0[14] = B0[15] = 0;
-   AES_encrypt(B0, B, &aes_ctx);
+   BZERO[0] &= 0x07;
+   BZERO[14] = BZERO[15] = 0;
+   AES_encrypt(BZERO, B, &aes_ctx);
 
    /* get the MIC trailer. it is after the end of our packet */
    memcpy(mic, data + len, WPA_CCMP_TRAILER);
@@ -100,7 +100,7 @@ int wpa_ccmp_decrypt(u_char *mac, u_char
    memcpy(decbuf, data + sizeof(struct wpa_header), len);
 
    /* decrypt the packet */
-   if (ccmp_decrypt(decbuf, B0, B, A, mic, len, &aes_ctx) != 0) {
+   if (ccmp_decrypt(decbuf, BZERO, B, A, mic, len, &aes_ctx) != 0) {
       //DEBUG_MSG(D_VERBOSE, "WPA (CCMP) decryption failed, packet was skipped");
       return -ENOTHANDLED;
    }
@@ -142,25 +142,25 @@ static inline void get_PN(u_char *PN, u_
 }
 
 
-static inline void get_B0(u_char *B0, u_char *mac, u_char *PN, size_t len)
+static inline void get_BZERO(u_char *BZERO, u_char *mac, u_char *PN, size_t len)
 {
-   B0[0] = 0x59;
-   B0[1] = 0; /* this will be set later by the callee */
+   BZERO[0] = 0x59;
+   BZERO[1] = 0; /* this will be set later by the callee */
 
-   memcpy(B0 + 2, mac + 10, ETH_ADDR_LEN);
+   memcpy(BZERO + 2, mac + 10, ETH_ADDR_LEN);
 
-   B0[8]  = PN[5];
-   B0[9]  = PN[4];
-   B0[10] = PN[3];
-   B0[11] = PN[2];
-   B0[12] = PN[1];
-   B0[13] = PN[0];
+   BZERO[8]  = PN[5];
+   BZERO[9]  = PN[4];
+   BZERO[10] = PN[3];
+   BZERO[11] = PN[2];
+   BZERO[12] = PN[1];
+   BZERO[13] = PN[0];
 
-   B0[14] = ( len >> 8 ) & 0xFF;
-   B0[15] = ( len & 0xFF );
+   BZERO[14] = ( len >> 8 ) & 0xFF;
+   BZERO[15] = ( len & 0xFF );
 }
 
-static inline void get_AAD(u_char *AAD, u_char *mac, u_char *B0)
+static inline void get_AAD(u_char *AAD, u_char *mac, u_char *BZERO)
 {
    AAD[0] = 0; /* AAD length >> 8 */
    AAD[1] = 0; /* this will be set below */
@@ -177,17 +177,17 @@ static inline void get_AAD(u_char *AAD,
    if ( (mac[0] & (0x80 | 0x08)) == 0x88 ) {
       AAD[24] = mac[24] & 0x0f; /* just priority bits */
       AAD[25] = 0;
-      B0[1] = AAD[24];
+      BZERO[1] = AAD[24];
       AAD[1] = 22 + 2;
    } else {
       memset(&AAD[24], 0, 2);
-      B0[1] = 0;
+      BZERO[1] = 0;
       AAD[1] = 22;
    }
 }
 
 
-static int ccmp_decrypt(u_char *enc, u_char *B0, u_char *B, u_char *A, u_char *mic, size_t len, AES_KEY *ctx)
+static int ccmp_decrypt(u_char *enc, u_char *BZERO, u_char *B, u_char *A, u_char *mic, size_t len, AES_KEY *ctx)
 {
    int i = 1;
 
@@ -195,7 +195,7 @@ static int ccmp_decrypt(u_char *enc, u_c
    len -= WPA_CCMP_TRAILER;
 
    while (len >= AES_BLOCK_SIZE) {
-      CCMP_DECRYPT(i, B, B0, enc, A, AES_BLOCK_SIZE, ctx);
+      CCMP_DECRYPT(i, B, BZERO, enc, A, AES_BLOCK_SIZE, ctx);
 
       enc += AES_BLOCK_SIZE;
       len -= AES_BLOCK_SIZE;
@@ -204,7 +204,7 @@ static int ccmp_decrypt(u_char *enc, u_c
 
    /* last block */
    if (len != 0) {
-      CCMP_DECRYPT(i, B, B0, enc, A, len, ctx);
+      CCMP_DECRYPT(i, B, BZERO, enc, A, len, ctx);
    }
 
    return memcmp(mic, A, WPA_CCMP_TRAILER);
--- ettercap-0.8.0.orig/src/ec_main.c
+++ ettercap-0.8.0/src/ec_main.c
@@ -79,7 +79,9 @@ int main(int argc, char *argv[])
    
    /* activate the signal handler */
    signal_handler();
-   
+#ifdef OS_GNU
+  fprintf(stdout,"%s is still not fully supported in this OS because of missing live capture support.", GBL_PROGRAM);
+#endif
    /* ettercap copyright */
    fprintf(stdout, "\n" EC_COLOR_BOLD "%s %s" EC_COLOR_END " copyright %s %s\n\n", 
          GBL_PROGRAM, GBL_VERSION, EC_COPYRIGHT, EC_AUTHORS);
--- /dev/null
+++ ettercap-0.8.0/src/ec_mem.c
@@ -0,0 +1,44 @@
+/*
+    ettercap -- global variables handling module
+
+    Copyright (C) ALoR & NaGA
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+*/
+
+#include <ec.h>
+
+void safe_free_mem(char **param, int *param_length, char *command)
+{
+   int k;
+
+   SAFE_FREE(command);
+        for(k= 0; k < (*param_length); ++k)
+                SAFE_FREE(param[k]);
+        SAFE_FREE(param);
+}
+
+
+
+
+
+
+
+
+/* EOF */
+
+// vim:ts=3:expandtab
+
--- ettercap-0.8.0.orig/src/ec_send.c
+++ ettercap-0.8.0/src/ec_send.c
@@ -18,13 +18,26 @@
     Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
 */
-
-#include <ec.h>
-
+#include <config.h>
 #if defined(OS_DARWIN) || defined(OS_BSD)
+   #define PCAP_DONT_INCLUDE_PCAP_BPF_H 1
+   #include <sys/types.h>
    #include <net/bpf.h>
    #include <sys/ioctl.h>
 #endif
+// Order MATTERS. ec.h includes pcap.h in ec_packet, hence the double inclusion of bpf.h file
+/*
+/usr/include/net/bpf.h:65:8: error: redefinition of 'struct bpf_program'
+ struct bpf_program {
+        ^
+In file included from /usr/include/pcap/pcap.h:51:0,
+                 from /usr/include/pcap.h:45,
+                 from /«PKGBUILDDIR»/include/ec_packet.h:11,
+                 from /«PKGBUILDDIR»/include/ec_sniff.h:6,
+                 from /«PKGBUILDDIR»/include/ec_globals.h:6,
+                 from /«PKGBUILDDIR»/include/ec.h:52,
+*/
+#include <ec.h>
 
 #include <ec_packet.h>
 #include <ec_send.h>
--- ettercap-0.8.0.orig/src/interfaces/CMakeLists.txt
+++ ettercap-0.8.0/src/interfaces/CMakeLists.txt
@@ -71,6 +71,13 @@ if(ENABLE_GTK)
 endif(ENABLE_GTK)
 
 
-add_library(ec_interfaces STATIC ${EC_TEXT_SRC} ${EC_DAEMON_SRC} ${EC_WDG_SRC} ${EC_CURSES_SRC} ${EC_GTK_SRC})
+add_library(ec_interfaces STATIC ../ec_interfaces.c ${EC_TEXT_SRC} ${EC_DAEMON_SRC} ${EC_WDG_SRC} ${EC_CURSES_SRC} ${EC_GTK_SRC})
 SET_TARGET_PROPERTIES(ec_interfaces PROPERTIES COMPILE_FLAGS -fPIC)
 target_link_libraries(ec_interfaces ${EC_LIBS})
+set_target_properties(ec_interfaces PROPERTIES 
+  ENABLE_EXPORTS On
+  LINK_INTERFACE_LIBRARIES ""
+  #  INSTALL_RPATH ${INSTALL_LIBDIR}
+  OUTPUT_NAME ec_interfaces 
+  )
+
--- ettercap-0.8.0.orig/src/interfaces/curses/widgets/wdg.h
+++ ettercap-0.8.0/src/interfaces/curses/widgets/wdg.h
@@ -117,7 +117,11 @@ extern void wdg_bug(char *file, const ch
 #define KEY_RETURN   '\r'
 #define KEY_TAB      '\t'
 #define KEY_CTRL_L   12
+// CTRL() is defined in /usr/include/.../ttydefaults.h which is pulled
+// in by some long chain via /usr/include/libnet.h
+#ifndef CTRL
 #define CTRL(x)      ((x) & 0x1f)
+#endif
 #define KEY_ESC      CTRL('[')
 
 /* information about the current screen */
--- ettercap-0.8.0.orig/src/interfaces/curses/widgets/wdg_file.c
+++ ettercap-0.8.0/src/interfaces/curses/widgets/wdg_file.c
@@ -18,6 +18,7 @@
     Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
 */
+#include <ec.h>
 
 #include <wdg.h>
 
@@ -123,7 +124,7 @@ static int wdg_file_destroy(struct wdg_o
    /* dealloc the structures */
    delwin(ww->win);
    
-   /* restore the initial workind direcory */
+   /* restore the initial working directory */
    chdir(ww->initpath);
 
    WDG_SAFE_FREE(wo->extend);
--- ettercap-0.8.0.orig/src/interfaces/text/ec_text.c
+++ ettercap-0.8.0/src/interfaces/text/ec_text.c
@@ -554,18 +554,18 @@ static void text_stats(void)
    DEBUG_MSG("text_stats (queue) : %lu %lu", (unsigned long)GBL_STATS->queue_curr, (unsigned long)GBL_STATS->queue_max); 
   
    
-   fprintf(stdout, "\n Received packets    : %8lld\n", GBL_STATS->ps_recv);
-   fprintf(stdout,   " Dropped packets     : %8lld  %.2f %%\n", GBL_STATS->ps_drop,
+   fprintf(stdout, "\n Received packets    : %8llu\n", (long long unsigned int)GBL_STATS->ps_recv);
+   fprintf(stdout,   " Dropped packets     : %8llu  %.2f %%\n", (long long unsigned int)GBL_STATS->ps_drop,
          (GBL_STATS->ps_recv) ? (float)GBL_STATS->ps_drop * 100 / GBL_STATS->ps_recv : 0 );
-   fprintf(stdout,   " Forwarded           : %8lld  bytes: %8lld\n\n", GBL_STATS->ps_sent, GBL_STATS->bs_sent);
+   fprintf(stdout,   " Forwarded           : %8llu  bytes: %8llu\n\n", (long long unsigned int)GBL_STATS->ps_sent, (long long unsigned int)GBL_STATS->bs_sent);
    
    fprintf(stdout,   " Current queue len   : %lu/%lu\n", (unsigned long)GBL_STATS->queue_curr, (unsigned long)GBL_STATS->queue_max);
    fprintf(stdout,   " Sampling rate       : %d\n\n", GBL_CONF->sampling_rate);
    
-   fprintf(stdout,   " Bottom Half received packet : pck: %8lld  byte: %8lld\n", 
-         GBL_STATS->bh.pck_recv, GBL_STATS->bh.pck_size);
-   fprintf(stdout,   " Top Half received packet    : pck: %8lld  byte: %8lld\n", 
-         GBL_STATS->th.pck_recv, GBL_STATS->th.pck_size);
+   fprintf(stdout,   " Bottom Half received packet : pck: %8llu  byte: %8lld\n", 
+         (long long unsigned int)GBL_STATS->bh.pck_recv, GBL_STATS->bh.pck_size);
+   fprintf(stdout,   " Top Half received packet    : pck: %8llu  byte: %8lld\n", 
+         (long long unsigned int)GBL_STATS->th.pck_recv, GBL_STATS->th.pck_size);
    fprintf(stdout,   " Interesting packets         : %.2f %%\n\n",
          (GBL_STATS->bh.pck_recv) ? (float)GBL_STATS->th.pck_recv * 100 / GBL_STATS->bh.pck_recv : 0 );
 
--- ettercap-0.8.0.orig/src/lua/share/core/ettercap_ffi.lua
+++ ettercap-0.8.0/src/lua/share/core/ettercap_ffi.lua
@@ -135,17 +135,17 @@ struct packet_object {
        */
       size_t disp_len;
       u_char * disp_data;
-      /* for modified packet this is the delta for the lenght */
+      /* for modified packet this is the delta for the length */
       int delta;  
       size_t inject_len;      /* len of the injection */
       u_char *inject;         /* the fuffer used for injection */
 
    } DATA;
 
-   size_t fwd_len;         /* lenght of the packet to be forwarded */
+   size_t fwd_len;         /* length of the packet to be forwarded */
    u_char * fwd_packet;    /* the pointer to the buffer to be forwarded */
    
-   size_t len;             /* total lenght of the packet */
+   size_t len;             /* total length of the packet */
    u_char * packet;        /* the buffer containing the real packet */
 
    /* Trace current session for injector chain */
--- /dev/null
+++ ettercap-0.8.0/src/os/ec_gnu.c
@@ -0,0 +1,53 @@
+/*
+    ettercap -- GNU hurd specific functions
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+*/
+/* XXX GNU/hurd seems to be NOT supported at this point
+   See https://github.com/Ettercap/ettercap/issues/151
+   http://www.mail-archive.com/debian-hurd@lists.debian.org/msg21345.html
+   These functions are just "stubs" to allow the package build for hurd
+   patches are welcome!
+*/
+#include <ec.h>
+void disable_ip_forward(void);
+static void restore_ip_forward(void);
+u_int16 get_iface_mtu(const char *iface);
+void disable_interface_offload(void);
+
+/*******************************************/
+
+void disable_ip_forward(void)
+{
+}
+
+static void restore_ip_forward(void)
+{
+}
+
+u_int16 get_iface_mtu(const char *iface)
+{
+   return 0;
+}
+
+void disable_interface_offload(void)
+{
+}
+
+/* EOF */
+
+// vim:ts=3:expandtab
+
--- ettercap-0.8.0.orig/src/os/ec_linux.c
+++ ettercap-0.8.0/src/os/ec_linux.c
@@ -31,7 +31,6 @@ void disable_ip_forward(void);
 static void restore_ip_forward(void);
 u_int16 get_iface_mtu(const char *iface);
 void disable_interface_offload(void);
-void safe_free_mem(char **param, int *param_length, char *command);
 
 /*******************************************/
 
@@ -133,15 +132,6 @@ u_int16 get_iface_mtu(const char *iface)
    return mtu;
 }
 
-void safe_free_mem(char **param, int *param_length, char *command)
-{
-   int k;
-
-   SAFE_FREE(command);
-	for(k= 0; k < (*param_length); ++k)
-		SAFE_FREE(param[k]);
-	SAFE_FREE(param);
-}
 
 /*
  * disable segmentation offload on interface
--- ettercap-0.8.0.orig/tests/CMakeLists.txt
+++ ettercap-0.8.0/tests/CMakeLists.txt
@@ -8,7 +8,7 @@ add_custom_target(test_verbose COMMAND $
 macro(_t NAME)
   add_executable(test_${NAME} test_${NAME}.c)
   add_dependencies(test_${NAME} bundled_check)
-  target_link_libraries(test_${NAME} lib_ettercap ${CHECK_LIBRARY})
+  target_link_libraries(test_${NAME} lib_ettercap ec_interfaces ${CHECK_LIBRARY})
   add_test(test_${NAME} ${CMAKE_CURRENT_BINARY_DIR}/test_${NAME})
 endmacro(_t NAME)
 
--- ettercap-0.8.0.orig/tests/check/CMakeLists.txt
+++ ettercap-0.8.0/tests/check/CMakeLists.txt
@@ -34,6 +34,8 @@ IF("${CMAKE_BUILD_TYPE}" STREQUAL "Debug
   SET(EXPORT_C_FLAGS "${EXPORT_C_FLAGS} ${CMAKE_C_FLAGS_DEBUG}")
 ELSEIF("${CMAKE_BUILD_TYPE}" STREQUAL "Release")
   SET(EXPORT_C_FLAGS "${EXPORT_C_FLAGS} ${CMAKE_C_FLAGS_RELEASE}")
+ELSEIF("${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo")
+  SET(EXPORT_C_FLAGS "${EXPORT_C_FLAGS} ${CMAKE_C_FLAGS_RELEASE}")
 ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
 
 SET(EXPORT_PREFIX ${CHECK_PREFIX})
--- ettercap-0.8.0.orig/utils/etterfilter/ef_grammar.y
+++ ettercap-0.8.0/utils/etterfilter/ef_grammar.y
@@ -412,7 +412,7 @@ struct {
  * This function is needed by bison. so it MUST exist.
  * It is the error handler.
  */
-int yyerror(char *s)  
+int yyerror(const char *s)  
 { 
    char *error;
    int i = 0;
