Commit 96d0531f authored by Natanael Copa's avatar Natanael Copa

main/libnl3: upgrade to 3.4.0

parent ab4e5f1f
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=libnl3
pkgver=3.2.28
pkgrel=1
pkgver=3.4.0
pkgrel=0
pkgdesc="Library for applications dealing with netlink sockets"
url="http://www.infradead.org/~tgr/libnl/"
arch="all"
......@@ -10,7 +10,9 @@ depends=
makedepends="linux-headers flex bison libtool autoconf automake"
checkdepends="check-dev"
subpackages="$pkgname-dev $pkgname-doc $pkgname-cli"
source="https://github.com/thom311/libnl/releases/download/libnl${pkgver//./_}/libnl-$pkgver.tar.gz"
source="https://github.com/thom311/libnl/releases/download/libnl${pkgver//./_}/libnl-$pkgver.tar.gz
libnl3-musl.patch
"
builddir="$srcdir"/libnl-$pkgver
prepare () {
......@@ -52,6 +54,5 @@ cli() {
mv "$pkgdir"/usr/bin "$subpkgdir"/usr/
}
md5sums="bab12db1eb94a42129f712a44be91a67 libnl-3.2.28.tar.gz"
sha256sums="cd608992c656e8f6e3ab6c1391b162a5a51c49336b9219f7f390e61fc5437c41 libnl-3.2.28.tar.gz"
sha512sums="b5f145ecafb2625ed1c42594afd6063f112a601077de5c35884b3c3bc8c562b29b52a006ccebd795c127fe69692a82def425c8605afed7e6d441582943e803d9 libnl-3.2.28.tar.gz"
sha512sums="6336e5c55c79ff2638de9c812cc1842871769236bad7f65c547dec35fafd91988b257fceab144a0cc133c4b29f61172f6552c53aa9fc723bdc783079c2b1851e libnl-3.4.0.tar.gz
a31ec4b76d2fc472072f2d770cb3f5819a6477230a97603a476ce175c0c94d25e74eff8dc0ce2e6baa96f0e450b82db508a152f418bdd72919cbd5521d5f82fd libnl3-musl.patch"
diff -Naur libnl-3.3.0_rc1.orig/include/linux-private/linux/if_ether.h libnl-3.3.0_rc1/include/linux-private/linux/if_ether.h
--- libnl-3.3.0_rc1.orig/include/linux-private/linux/if_ether.h 2017-03-08 19:56:31.824516933 -0800
+++ libnl-3.3.0_rc1/include/linux-private/linux/if_ether.h 2017-03-08 20:07:01.938237767 -0800
@@ -22,6 +22,7 @@
#define _LINUX_IF_ETHER_H
#include <linux/types.h>
+#include <linux/libc-compat.h>
/*
* IEEE 802.3 Ethernet magic constants. The frame sizes omit the preamble
@@ -117,10 +118,12 @@
* This is an Ethernet frame header.
*/
+#if __UAPI_DEF_ETHHDR
struct ethhdr {
unsigned char h_dest[ETH_ALEN]; /* destination eth addr */
unsigned char h_source[ETH_ALEN]; /* source ether addr */
__be16 h_proto; /* packet type ID field */
} __attribute__((packed));
+#endif
#endif /* _LINUX_IF_ETHER_H */
diff -Naur libnl-3.3.0_rc1.orig/include/linux-private/linux/libc-compat.h libnl-3.3.0_rc1/include/linux-private/linux/libc-compat.h
--- libnl-3.3.0_rc1.orig/include/linux-private/linux/libc-compat.h 2017-03-08 19:56:31.823516923 -0800
+++ libnl-3.3.0_rc1/include/linux-private/linux/libc-compat.h 2017-03-08 20:12:30.376843489 -0800
@@ -48,10 +48,18 @@
#ifndef _LIBC_COMPAT_H
#define _LIBC_COMPAT_H
-/* We have included glibc headers... */
-#if defined(__GLIBC__)
+/* We're used from userspace... */
+#if !defined(__KERNEL__)
-/* Coordinate with glibc netinet/in.h header. */
+/* Coordinate with libc netinet/if_ether.h */
+#ifdef _NETINET_IF_ETHER_H /* musl */
+#define __UAPI_DEF_ETHHDR 0
+#else
+/* glibc uses __NETINET_IF_ETHER_H, and uses the uapi header. */
+#define __UAPI_DEF_ETHHDR 1
+#endif
+
+/* Coordinate with libc netinet/in.h header. */
#if defined(_NETINET_IN_H)
/* GLIBC headers included first so don't define anything
@@ -64,15 +72,7 @@
#define __UAPI_DEF_IN_CLASS 0
#define __UAPI_DEF_IN6_ADDR 0
-/* The exception is the in6_addr macros which must be defined
- * if the glibc code didn't define them. This guard matches
- * the guard in glibc/inet/netinet/in.h which defines the
- * additional in6_addr macros e.g. s6_addr16, and s6_addr32. */
-#if defined(__USE_MISC) || defined (__USE_GNU)
#define __UAPI_DEF_IN6_ADDR_ALT 0
-#else
-#define __UAPI_DEF_IN6_ADDR_ALT 1
-#endif
#define __UAPI_DEF_SOCKADDR_IN6 0
#define __UAPI_DEF_IPV6_MREQ 0
#define __UAPI_DEF_IPPROTO_V6 0
@@ -83,7 +83,7 @@
#else
/* Linux headers included first, and we must define everything
- * we need. The expectation is that glibc will check the
+ * we need. The expectation is that libc will check the
* __UAPI_DEF_* defines and adjust appropriately. */
#define __UAPI_DEF_IN_ADDR 1
#define __UAPI_DEF_IN_IPPROTO 1
@@ -93,7 +93,7 @@
#define __UAPI_DEF_IN_CLASS 1
#define __UAPI_DEF_IN6_ADDR 1
-/* We unconditionally define the in6_addr macros and glibc must
+/* We unconditionally define the in6_addr macros and libc must
* coordinate. */
#define __UAPI_DEF_IN6_ADDR_ALT 1
#define __UAPI_DEF_SOCKADDR_IN6 1
@@ -115,7 +115,10 @@
/* If we did not see any headers from any supported C libraries,
* or we are being included in the kernel, then define everything
* that we need. */
-#else /* !defined(__GLIBC__) */
+#else /* defined(__KERNEL__) */
+
+/* Definitions for if/ether.h */
+#define __UAPI_DEF_ETHHDR 1
/* Definitions for in.h */
#define __UAPI_DEF_IN_ADDR 1
@@ -138,6 +141,6 @@
/* Definitions for xattr.h */
#define __UAPI_DEF_XATTR 1
-#endif /* __GLIBC__ */
+#endif /* defined(__KERNEL__) */
#endif /* _LIBC_COMPAT_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment