summary refs log tree commit diff
path: root/pkgs/os-specific/linux/libnl
diff options
context:
space:
mode:
authorEvgeny Egorochkin <phreedom.stdin@gmail.com>2011-01-03 17:02:47 +0000
committerEvgeny Egorochkin <phreedom.stdin@gmail.com>2011-01-03 17:02:47 +0000
commitbfc2a3865143588948fcf324f1586dbf35ffbc6d (patch)
treea917a0aff3dcccd7259c4d23919b154e866426d6 /pkgs/os-specific/linux/libnl
parente1309dee31aa5221d07997bf5ed73baa36094b15 (diff)
downloadnixpkgs-bfc2a3865143588948fcf324f1586dbf35ffbc6d.tar
nixpkgs-bfc2a3865143588948fcf324f1586dbf35ffbc6d.tar.gz
nixpkgs-bfc2a3865143588948fcf324f1586dbf35ffbc6d.tar.bz2
nixpkgs-bfc2a3865143588948fcf324f1586dbf35ffbc6d.tar.lz
nixpkgs-bfc2a3865143588948fcf324f1586dbf35ffbc6d.tar.xz
nixpkgs-bfc2a3865143588948fcf324f1586dbf35ffbc6d.tar.zst
nixpkgs-bfc2a3865143588948fcf324f1586dbf35ffbc6d.zip
libnl 1.x: packaged.
svn path=/nixpkgs/trunk/; revision=25365
Diffstat (limited to 'pkgs/os-specific/linux/libnl')
-rw-r--r--pkgs/os-specific/linux/libnl/libnl-1.1-flags.patch11
-rw-r--r--pkgs/os-specific/linux/libnl/libnl-1.1-glibc-2.8-ULONG_MAX.patch13
-rw-r--r--pkgs/os-specific/linux/libnl/libnl-1.1-minor-leaks.patch40
-rw-r--r--pkgs/os-specific/linux/libnl/libnl-1.1-vlan-header.patch80
-rw-r--r--pkgs/os-specific/linux/libnl/v1.nix27
5 files changed, 171 insertions, 0 deletions
diff --git a/pkgs/os-specific/linux/libnl/libnl-1.1-flags.patch b/pkgs/os-specific/linux/libnl/libnl-1.1-flags.patch
new file mode 100644
index 00000000000..bb09b362660
--- /dev/null
+++ b/pkgs/os-specific/linux/libnl/libnl-1.1-flags.patch
@@ -0,0 +1,11 @@
+--- libnl-1.1/lib/Makefile.orig	2008-01-14 16:48:45.000000000 +0100
++++ libnl-1.1/lib/Makefile	2009-05-26 09:47:42.000000000 +0200
+@@ -48,7 +48,7 @@
+ 
+ $(OUT_SLIB): ../Makefile.opts $(OBJ)
+ 	@echo "  LD $(OUT_SLIB)"; \
+-	$(CC) -shared -Wl,-soname,libnl.so.1 -o $(OUT_SLIB) $(OBJ) $(LIBNL_LIB) -lc
++	$(CC) $(CFLAGS) $(LDFLAGS) -shared -Wl,-soname,libnl.so.1 -o $(OUT_SLIB) $(OBJ) $(LIBNL_LIB) -lc
+ 	@echo "  LN $(OUT_SLIB) $(LN1_SLIB)"; \
+ 	rm -f $(LN1_SLIB) ; $(LN) -s $(OUT_SLIB) $(LN1_SLIB)
+ 	@echo "  LN $(LN1_SLIB) $(LN_SLIB)"; \
diff --git a/pkgs/os-specific/linux/libnl/libnl-1.1-glibc-2.8-ULONG_MAX.patch b/pkgs/os-specific/linux/libnl/libnl-1.1-glibc-2.8-ULONG_MAX.patch
new file mode 100644
index 00000000000..79dd039a338
--- /dev/null
+++ b/pkgs/os-specific/linux/libnl/libnl-1.1-glibc-2.8-ULONG_MAX.patch
@@ -0,0 +1,13 @@
+https://bugs.gentoo.org/show_bug.cgi?id=225393
+
+--- libnl-1.1/include/netlink-local.h	2008-06-09 07:54:20 +0000
++++ libnl-1.1/include/netlink-local.h	2008-06-09 07:54:47 +0000
+@@ -26,6 +26,7 @@
+ #include <sys/socket.h>
+ #include <inttypes.h>
+ #include <assert.h>
++#include <limits.h>
+ 
+ #include <arpa/inet.h>
+ #include <netdb.h>
+
diff --git a/pkgs/os-specific/linux/libnl/libnl-1.1-minor-leaks.patch b/pkgs/os-specific/linux/libnl/libnl-1.1-minor-leaks.patch
new file mode 100644
index 00000000000..855a6ab3912
--- /dev/null
+++ b/pkgs/os-specific/linux/libnl/libnl-1.1-minor-leaks.patch
@@ -0,0 +1,40 @@
+From: Patrick McHardy <kaber@trash.net>
+Date: Fri, 18 Jan 2008 16:55:49 +0000 (+0100)
+Subject: [LIBNL]: Fix minor memleaks on exit
+X-Git-Url: http://git.kernel.org/?p=libs%2Fnetlink%2Flibnl.git;a=commitdiff_plain;h=b64f15d6f947839236fa276d473d238f8c9b9d57;hp=e91bb2ffb090955d443e643a25b250bf3d33534a
+
+[LIBNL]: Fix minor memleaks on exit
+
+Make valgrind happy ...
+
+Signed-off-by: Patrick McHardy <kaber@trash.net>
+---
+
+diff --git a/lib/route/route_utils.c b/lib/route/route_utils.c
+index a12d169..1386cda 100644
+--- a/lib/route/route_utils.c
++++ b/lib/route/route_utils.c
+@@ -63,6 +63,11 @@ static void __init init_routing_table_names(void)
+ 	add_routing_table_name(RT_TABLE_LOCAL, "local");
+ };
+ 
++static void __exit release_routing_table_names(void)
++{
++	__trans_list_clear(&table_names);
++}
++
+ int rtnl_route_read_table_names(const char *path)
+ {
+ 	__trans_list_clear(&table_names);
+@@ -104,6 +109,11 @@ static void __init init_proto_names(void)
+ 	add_proto_name(RTPROT_STATIC, "static");
+ };
+ 
++static void __exit release_proto_names(void)
++{
++	__trans_list_clear(&proto_names);
++}
++
+ int rtnl_route_read_protocol_names(const char *path)
+ {
+ 	__trans_list_clear(&proto_names);
diff --git a/pkgs/os-specific/linux/libnl/libnl-1.1-vlan-header.patch b/pkgs/os-specific/linux/libnl/libnl-1.1-vlan-header.patch
new file mode 100644
index 00000000000..c4c2fc6382d
--- /dev/null
+++ b/pkgs/os-specific/linux/libnl/libnl-1.1-vlan-header.patch
@@ -0,0 +1,80 @@
+From: Patrick McHardy <kaber@trash.net>
+Date: Fri, 18 Jan 2008 16:55:48 +0000 (+0100)
+Subject: [LIBNL]: Add if_vlan.h
+X-Git-Url: http://git.kernel.org/?p=libs%2Fnetlink%2Flibnl.git;a=commitdiff_plain;h=e91bb2ffb090955d443e643a25b250bf3d33534a;hp=7f6b7a8eea0334b34d58dec72c66121a76f08958
+
+[LIBNL]: Add if_vlan.h
+
+vlan support needs VLAN_FLAG_REORDER_HDR, which is not available in
+older if_vlan.h versions. Add the current version from the kernel.
+
+Signed-off-by: Patrick McHardy <kaber@trash.net>
+---
+
+diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
+new file mode 100644
+index 0000000..068cd7b
+--- /dev/null
++++ include/linux/if_vlan.h
+@@ -0,0 +1,61 @@
++/*
++ * VLAN		An implementation of 802.1Q VLAN tagging.
++ *
++ * Authors:	Ben Greear <greearb@candelatech.com>
++ *
++ *		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.
++ *
++ */
++
++#ifndef _LINUX_IF_VLAN_H_
++#define _LINUX_IF_VLAN_H_
++
++
++/* VLAN IOCTLs are found in sockios.h */
++
++/* Passed in vlan_ioctl_args structure to determine behaviour. */
++enum vlan_ioctl_cmds {
++	ADD_VLAN_CMD,
++	DEL_VLAN_CMD,
++	SET_VLAN_INGRESS_PRIORITY_CMD,
++	SET_VLAN_EGRESS_PRIORITY_CMD,
++	GET_VLAN_INGRESS_PRIORITY_CMD,
++	GET_VLAN_EGRESS_PRIORITY_CMD,
++	SET_VLAN_NAME_TYPE_CMD,
++	SET_VLAN_FLAG_CMD,
++	GET_VLAN_REALDEV_NAME_CMD, /* If this works, you know it's a VLAN device, btw */
++	GET_VLAN_VID_CMD /* Get the VID of this VLAN (specified by name) */
++};
++
++enum vlan_flags {
++	VLAN_FLAG_REORDER_HDR	= 0x1,
++};
++
++enum vlan_name_types {
++	VLAN_NAME_TYPE_PLUS_VID, /* Name will look like:  vlan0005 */
++	VLAN_NAME_TYPE_RAW_PLUS_VID, /* name will look like:  eth1.0005 */
++	VLAN_NAME_TYPE_PLUS_VID_NO_PAD, /* Name will look like:  vlan5 */
++	VLAN_NAME_TYPE_RAW_PLUS_VID_NO_PAD, /* Name will look like:  eth0.5 */
++	VLAN_NAME_TYPE_HIGHEST
++};
++
++struct vlan_ioctl_args {
++	int cmd; /* Should be one of the vlan_ioctl_cmds enum above. */
++	char device1[24];
++
++        union {
++		char device2[24];
++		int VID;
++		unsigned int skb_priority;
++		unsigned int name_type;
++		unsigned int bind_type;
++		unsigned int flag; /* Matches vlan_dev_info flags */
++        } u;
++
++	short vlan_qos;
++};
++
++#endif /* !(_LINUX_IF_VLAN_H_) */
diff --git a/pkgs/os-specific/linux/libnl/v1.nix b/pkgs/os-specific/linux/libnl/v1.nix
new file mode 100644
index 00000000000..f3f7f3fa732
--- /dev/null
+++ b/pkgs/os-specific/linux/libnl/v1.nix
@@ -0,0 +1,27 @@
+{stdenv, fetchurl, bison, flex}:
+
+stdenv.mkDerivation rec {
+  name = "libnl-1.1";
+
+  src = fetchurl {
+    url = "${meta.homepage}files/${name}.tar.gz";
+    sha256 = "1hzd48z8h8abkclq90wb7cciynpg3pwgyd0gzb5g12ndnv7s9kim";
+  };
+
+  buildInputs = [ bison flex ];
+  postConfigure = "type -tp flex";
+
+  patches = [
+    ./libnl-1.1-flags.patch
+    ./libnl-1.1-glibc-2.8-ULONG_MAX.patch
+    ./libnl-1.1-minor-leaks.patch
+    ./libnl-1.1-vlan-header.patch
+  ];
+
+  meta = {
+    homepage = "http://www.infradead.org/~tgr/libnl/";
+    description = "Linux NetLink interface library";
+    maintainers = [ stdenv.lib.maintainers.urkud ];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}