From bfc2a3865143588948fcf324f1586dbf35ffbc6d Mon Sep 17 00:00:00 2001 From: Evgeny Egorochkin Date: Mon, 3 Jan 2011 17:02:47 +0000 Subject: libnl 1.x: packaged. svn path=/nixpkgs/trunk/; revision=25365 --- pkgs/os-specific/linux/libnl/libnl-1.1-flags.patch | 11 +++ .../libnl/libnl-1.1-glibc-2.8-ULONG_MAX.patch | 13 ++++ .../linux/libnl/libnl-1.1-minor-leaks.patch | 40 +++++++++++ .../linux/libnl/libnl-1.1-vlan-header.patch | 80 ++++++++++++++++++++++ pkgs/os-specific/linux/libnl/v1.nix | 27 ++++++++ 5 files changed, 171 insertions(+) create mode 100644 pkgs/os-specific/linux/libnl/libnl-1.1-flags.patch create mode 100644 pkgs/os-specific/linux/libnl/libnl-1.1-glibc-2.8-ULONG_MAX.patch create mode 100644 pkgs/os-specific/linux/libnl/libnl-1.1-minor-leaks.patch create mode 100644 pkgs/os-specific/linux/libnl/libnl-1.1-vlan-header.patch create mode 100644 pkgs/os-specific/linux/libnl/v1.nix (limited to 'pkgs/os-specific/linux/libnl') 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 + #include + #include ++#include + + #include + #include + 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 +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 +--- + +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 +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 +--- + +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 ++ * ++ * 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; + }; +} -- cgit 1.4.1