From 0ad167e25bc86bf0554e3c3711dd1329dbb95d0b Mon Sep 17 00:00:00 2001 From: Alex Suykov Date: Thu, 26 Mar 2015 00:15:06 +0200 Subject: [PATCH] aiccu: musl patches Fixes http://autobuild.buildroot.net/results/8c666ef11310868097601b6de1dd25779729b878/ if_ether.h issue discussion: http://www.openwall.com/lists/musl/2012/10/11/1 Patch 0001-gnutls-and-uclibc-fixes split into gnutls part (0001) and res_ninit part (0005) which is not uclibc-specific but happens to affect musl as well. Signed-off-by: Alex Suykov Signed-off-by: Thomas Petazzoni --- ...d-uclibc-fixes.patch => 0001-gnutls.patch} | 31 ----------------- package/aiccu/0004-if-ether-header.patch | 23 +++++++++++++ package/aiccu/0005-res-ninit.patch | 33 +++++++++++++++++++ 3 files changed, 56 insertions(+), 31 deletions(-) rename package/aiccu/{0001-gnutls-and-uclibc-fixes.patch => 0001-gnutls.patch} (70%) create mode 100644 package/aiccu/0004-if-ether-header.patch create mode 100644 package/aiccu/0005-res-ninit.patch diff --git a/package/aiccu/0001-gnutls-and-uclibc-fixes.patch b/package/aiccu/0001-gnutls.patch similarity index 70% rename from package/aiccu/0001-gnutls-and-uclibc-fixes.patch rename to package/aiccu/0001-gnutls.patch index d316f8f6ca..462179ee6b 100644 --- a/package/aiccu/0001-gnutls-and-uclibc-fixes.patch +++ b/package/aiccu/0001-gnutls.patch @@ -1,5 +1,4 @@ aiccu.h, common.c, common.h: fixes for deprecated GNUTLS functions and types -resolver.c: fixes for selection of wrong resolver function under uclibc Signed-off-by: Michael Rommel @@ -72,33 +71,3 @@ diff -purN aiccu_20070115.orig/common/common.h aiccu_20070115/common/common.h #endif }; -diff -purN aiccu_20070115.orig/common/resolver.c aiccu_20070115/common/resolver.c ---- aiccu_20070115.orig/common/resolver.c 2006-07-23 16:55:14.000000000 +0200 -+++ aiccu_20070115/common/resolver.c 2013-08-31 23:44:31.574866862 +0200 -@@ -26,7 +26,7 @@ - - int getrrs(const char *label, int rrtype, void gotrec(unsigned int num, int type, const char *record)) - { --#ifdef _LINUX -+#if defined(_LINUX) && !defined(__UCLIBC__) - struct __res_state res; - #endif - unsigned char answer[8192]; -@@ -38,7 +38,7 @@ int getrrs(const char *label, int rrtype - uint16_t type = 0, class = 0; - uint32_t ttl = 0; - --#ifdef _LINUX -+#if defined(_LINUX) && !defined(__UCLIBC__) - memset(&res, 0, sizeof(res)); - res.options = RES_DEBUG; - res_ninit(&res); -@@ -47,7 +47,7 @@ int getrrs(const char *label, int rrtype - #endif - - memset(answer, 0, sizeof(answer)); --#ifdef _LINUX -+#if defined(_LINUX) && !defined(__UCLIBC__) - ret = res_nquery(&res, label, C_IN, rrtype, answer, sizeof(answer)); - #else - ret = res_query(label, C_IN, rrtype, answer, sizeof(answer)); diff --git a/package/aiccu/0004-if-ether-header.patch b/package/aiccu/0004-if-ether-header.patch new file mode 100644 index 0000000000..48e8ceb6b1 --- /dev/null +++ b/package/aiccu/0004-if-ether-header.patch @@ -0,0 +1,23 @@ +musl does not allow using together with headers. +Since there are both netinet/if_ether.h and linux/if_ether.h providing +the same definitions, use linux/if_ether.h whenever other linux/* +headers are included. + +Signed-off-by: Alex Suykov + +--- aiccu/common/common.h ++++ aiccu/common/common.h +@@ -91,11 +91,12 @@ + #include + + #include +- #include + #ifdef linux + #include ++ #include + #include + #else ++ #include + #ifdef _DFBSD + #include + #else diff --git a/package/aiccu/0005-res-ninit.patch b/package/aiccu/0005-res-ninit.patch new file mode 100644 index 0000000000..89770fbfdd --- /dev/null +++ b/package/aiccu/0005-res-ninit.patch @@ -0,0 +1,33 @@ +res_ninit is available in glibc but not in uclibc or musl. + +Signed-off-by: Alex Suykov + +--- aiccu/common/resolver.c ++++ aiccu/common/resolver.c +@@ -26,7 +26,7 @@ + + int getrrs(const char *label, int rrtype, void gotrec(unsigned int num, int type, const char *record)) + { +-#ifdef _LINUX ++#ifdef __GLIBC__ + struct __res_state res; + #endif + unsigned char answer[8192]; +@@ -38,7 +38,7 @@ int getrrs(const char *label, int rrtype + uint16_t type = 0, class = 0; + uint32_t ttl = 0; + +-#ifdef _LINUX ++#ifdef __GLIBC__ + memset(&res, 0, sizeof(res)); + res.options = RES_DEBUG; + res_ninit(&res); +@@ -47,7 +47,7 @@ int getrrs(const char *label, int rrtype + #endif + + memset(answer, 0, sizeof(answer)); +-#ifdef _LINUX ++#ifdef __GLIBC__ + ret = res_nquery(&res, label, C_IN, rrtype, answer, sizeof(answer)); + #else + ret = res_query(label, C_IN, rrtype, answer, sizeof(answer)); -- 2.30.2