[package] babel: include upstream patch until next release
authorGabriel Kerneis <kerneis@pps.jussieu.fr>
Fri, 8 Oct 2010 15:05:50 +0000 (15:05 +0000)
committerGabriel Kerneis <kerneis@pps.jussieu.fr>
Fri, 8 Oct 2010 15:05:50 +0000 (15:05 +0000)
Fri Sep 24 16:25:40 CEST 2010  Juliusz Chroboczek <jch@pps.jussieu.fr>
  * Don't use __attribute__((packed)), it is buggy.

SVN-Revision: 23325

net/babel/Makefile
net/babel/patches/001-buggy-packed.patch [new file with mode: 0644]

index dcc96d44c392b39d5ca197e8e8a98c50d99a1c98..497f1487d48dd7dd0a584c9fc494e613000d6f8c 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=babeld
 PKG_VERSION:=1.0.1
-PKG_RELEASE:=4
+PKG_RELEASE:=5
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.pps.jussieu.fr/~jch/software/files/
diff --git a/net/babel/patches/001-buggy-packed.patch b/net/babel/patches/001-buggy-packed.patch
new file mode 100644 (file)
index 0000000..f180731
--- /dev/null
@@ -0,0 +1,22 @@
+Fri Sep 24 16:25:40 CEST 2010  Juliusz Chroboczek <jch@pps.jussieu.fr>
+  * Don't use __attribute__((packed)), it is buggy.
+diff -rN -u old-babeld/util.h new-babeld/util.h
+--- old-babeld/util.h  2010-10-08 15:41:20.000000000 +0200
++++ new-babeld/util.h  2010-10-08 15:41:20.000000000 +0200
+@@ -20,7 +20,15 @@
+ THE SOFTWARE.
+ */
+-#if defined __GNUC__
++#if defined(i386) || defined(__mc68020__) || defined(__x86_64__)
++#define DO_NTOHS(_d, _s) do { _d = ntohs(*(unsigned short*)(_s)); } while(0)
++#define DO_NTOHL(_d, _s) do { _d = ntohl(*(unsigned*)(_s)); } while(0)
++#define DO_HTONS(_d, _s) do { *(unsigned short*)(_d) = htons(_s); } while(0)
++#define DO_HTONL(_d, _s) do { *(unsigned*)(_d) = htonl(_s); } while(0)
++/* Some versions of gcc seem to be buggy, and ignore the packed attribute.
++   Disable this code until the issue is clarified. */
++/* #elif defined __GNUC__*/
++#elif 0
+ struct __us { unsigned short x __attribute__((packed)); };
+ #define DO_NTOHS(_d, _s) \
+     do { _d = ntohs(((const struct __us*)(_s))->x); } while(0)