Merge pull request #166391 from tfc/libnet-1.2

This commit is contained in:
Ben Siraphob 2022-04-03 12:50:35 -05:00 committed by GitHub
commit 6cca62201f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 35 deletions

View file

@ -1,15 +1,23 @@
{ lib, stdenv, fetchurl }:
{ lib, stdenv, fetchFromGitHub, autoconf, automake, libtool }:
stdenv.mkDerivation rec {
pname = "libnet";
version = "1.2-rc3";
version = "1.2";
src = fetchurl {
url = "mirror://sourceforge/libnet-dev/${pname}-${version}.tar.gz";
sha256 = "0qsapqa7dzq9f6lb19kzilif0pj82b64fjv5bq086hflb9w81hvj";
src = fetchFromGitHub {
owner = "sam-github";
repo = "libnet";
rev = "v${version}";
sha256 = "sha256-Y/wd9c4whUbfpvWvKzJV6vJN3AlA14XBejchRG6wBc4=";
};
patches = [ ./fix-includes.patch ];
nativeBuildInputs = [
autoconf
automake
libtool
];
preConfigure = "./autogen.sh";
meta = with lib; {
homepage = "https://github.com/sam-github/libnet";

View file

@ -1,29 +0,0 @@
--- libnet-1.1.6.orig/src/libnet_link_linux.c
+++ libnet-1.1.6/src/libnet_link_linux.c
@@ -30,26 +30,15 @@
#include <sys/time.h>
#include <net/if.h>
-#if (__GLIBC__)
#include <netinet/if_ether.h>
#include <net/if_arp.h>
-#else
-#include <linux/if_arp.h>
-#include <linux/if_ether.h>
-#endif
#if (HAVE_PACKET_SOCKET)
#ifndef SOL_PACKET
#define SOL_PACKET 263
#endif /* SOL_PACKET */
-#if __GLIBC__ >= 2 && __GLIBC_MINOR >= 1
#include <netpacket/packet.h>
#include <net/ethernet.h> /* the L2 protocols */
-#else
-#include <asm/types.h>
-#include <linux/if_packet.h>
-#include <linux/if_ether.h> /* The L2 protocols */
-#endif
#endif /* HAVE_PACKET_SOCKET */
#include "../include/libnet.h"