[PATCH 3/3] libnetfilter-conntrack byte alignment

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Aligns buffers to maximum alignment of architecture to make the cast of
char pointers to struct pointers more portable.

Signed-off-by: Fabian Hugelshofer <hugelshofer2006@xxxxxx>


diff -ruN libnetfilter_conntrack-0.0.89.orig/src/conntrack/api.c libnetfilter_conntrack-0.0.89/src/conntrack/api.c
--- libnetfilter_conntrack-0.0.89.orig/src/conntrack/api.c	2008-06-02 19:35:12.000000000 +0100
+++ libnetfilter_conntrack-0.0.89/src/conntrack/api.c	2008-06-02 19:38:07.000000000 +0100
@@ -561,7 +561,7 @@
 	       const void *data)
 {
 	size_t size = 4096;	/* enough for now */
-	char buffer[4096];
+	char buffer[4096] __attribute__ ((aligned));
 	struct nfnlhdr *req = (struct nfnlhdr *) buffer;
 
 	assert(h != NULL);
diff -ruN libnetfilter_conntrack-0.0.89.orig/src/expect/api.c libnetfilter_conntrack-0.0.89/src/expect/api.c
--- libnetfilter_conntrack-0.0.89.orig/src/expect/api.c	2008-06-02 19:35:12.000000000 +0100
+++ libnetfilter_conntrack-0.0.89/src/expect/api.c	2008-06-02 19:39:59.000000000 +0100
@@ -507,7 +507,7 @@
 	        const void *data)
 {
 	size_t size = 4096;	/* enough for now */
-	char buffer[4096];
+	char buffer[4096] __attribute__ ((aligned));
 	struct nfnlhdr *req = (struct nfnlhdr *) buffer;
 
 	assert(h != NULL);


--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux