about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorBobby Rong <rjl931189261@126.com>2021-12-17 14:57:52 +0800
committerGitHub <noreply@github.com>2021-12-17 14:57:52 +0800
commit51b17994af91966880d3ccd28adf470fc8be5fef (patch)
treeb8e893ee69a52a87fbc41790b045b74a9184fbca /pkgs
parentc4b3a22202972ef77e280705591c112c2448645f (diff)
parentd98c11f92fef5a4d22e935c94c3d7629b25ae56c (diff)
Merge pull request #149124 from hrhino/fix/driftnet
driftnet: fix and cleanup
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/tools/networking/driftnet/default.nix4
-rw-r--r--pkgs/tools/networking/driftnet/fix-darwin-build.patch61
-rw-r--r--pkgs/tools/networking/driftnet/libwebsockets-4.3.0.patch12
3 files changed, 15 insertions, 62 deletions
diff --git a/pkgs/tools/networking/driftnet/default.nix b/pkgs/tools/networking/driftnet/default.nix
index 042f29d3ca313..1f489b7fbc71d 100644
--- a/pkgs/tools/networking/driftnet/default.nix
+++ b/pkgs/tools/networking/driftnet/default.nix
@@ -35,6 +35,8 @@ stdenv.mkDerivation rec {
       url = "https://github.com/deiv/driftnet/pull/33/commits/bef5f3509ab5710161e9e21ea960a997eada534f.patch";
       sha256 = "1b7p9fkgp7dxv965l7q7y632s80h3nnrkaqnak2h0hakwv0i4pvm";
     })
+    # https://github.com/deiv/driftnet/issues/37
+    ./libwebsockets-4.3.0.patch
   ];
 
   enableParallelBuilding = true;
@@ -59,6 +61,6 @@ stdenv.mkDerivation rec {
     homepage = "https://github.com/deiv/driftnet";
     maintainers = with maintainers; [ offline ];
     platforms = platforms.linux ++ platforms.darwin;
-    license = licenses.gpl2;
+    license = licenses.gpl2Plus;
   };
 }
diff --git a/pkgs/tools/networking/driftnet/fix-darwin-build.patch b/pkgs/tools/networking/driftnet/fix-darwin-build.patch
deleted file mode 100644
index d1bde0f2e605f..0000000000000
--- a/pkgs/tools/networking/driftnet/fix-darwin-build.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-diff --git a/src/compat/compat.h b/src/compat/compat.h
-index 6add422..ea80406 100644
---- a/src/compat/compat.h
-+++ b/src/compat/compat.h
-@@ -17,7 +17,7 @@
-     #include <config.h>
- #endif
- 
--#ifdef __FreeBSD__
-+#if defined(__FreeBSD__) || defined(__APPLE__)
-     #include <sys/types.h>
- #endif
- 
-diff --git a/src/network/layer2.c b/src/network/layer2.c
-index 763f0ac..2497b72 100644
---- a/src/network/layer2.c
-+++ b/src/network/layer2.c
-@@ -14,7 +14,7 @@
- 
- #include <string.h>
- 
--#ifdef __FreeBSD__
-+#if defined(__FreeBSD__) || defined(__APPLE__)
- #include <netinet/in_systm.h>
- #include <netinet/in.h>
- #else
-@@ -29,7 +29,7 @@
- /*
-  * Freebsd and Cygwin doesn't define 'ethhdr'
-  */
--#if defined(__FreeBSD__) || defined(__CYGWIN__)
-+#if defined(__FreeBSD__) || defined(__CYGWIN__) || defined(__APPLE__)
- 
- #define ETH_ALEN	6			/* Octets in one ethernet addr	 */
- #define ETH_P_IP	0x0800		/* Internet Protocol packet	*/
-diff --git a/src/network/layer3.c b/src/network/layer3.c
-index 7864126..aae2041 100644
---- a/src/network/layer3.c
-+++ b/src/network/layer3.c
-@@ -15,7 +15,7 @@
- #include <string.h>
- #include <assert.h>
- 
--#ifdef __FreeBSD__
-+#if defined(__FreeBSD__) || defined(__APPLE__)
- #include <netinet/in_systm.h>
- #include <netinet/in.h>
- #include <sys/socket.h>
-diff --git a/src/pid.c b/src/pid.c
-index 621834e..94e7dcc 100644
---- a/src/pid.c
-+++ b/src/pid.c
-@@ -14,7 +14,7 @@
- 
- #include "compat/compat.h"
- 
--#ifdef __FreeBSD__
-+#if defined(__FreeBSD__) || defined(__APPLE__)
- #include <sys/stat.h>
- #endif
- #include <fcntl.h>
diff --git a/pkgs/tools/networking/driftnet/libwebsockets-4.3.0.patch b/pkgs/tools/networking/driftnet/libwebsockets-4.3.0.patch
new file mode 100644
index 0000000000000..5e5cfd50af3e7
--- /dev/null
+++ b/pkgs/tools/networking/driftnet/libwebsockets-4.3.0.patch
@@ -0,0 +1,12 @@
+diff --git a/src/http_display/httpd.c b/src/http_display/httpd.c
+index f4709ef..7921d23 100644
+--- a/src/http_display/httpd.c
++++ b/src/http_display/httpd.c
+@@ -191,7 +191,6 @@ static void * http_server_dispatch(void *arg)
+         LWSMPRO_FILE,                  /* mount type is a directory in a filesystem */
+         1,                                     /* strlen("/"), ie length of the mountpoint */
+         NULL,
+-        { NULL, NULL } // sentinel
+     };
+
+     memset(&info, 0, sizeof info);