I got stuck in Starbucks with my old PPC PowerBook so had to figure out
the fwknop issue to get access to my Linux box ;) I got it working.
I noticed that there were these compile warnings with 2.0.4.
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -I/opt/local/include -I
../common -g -O2 -Wall -Wformat -Wformat-security -fstack-protector-all
-fstack-protector -D_FORTIFY_SOURCE=2 -MT md5.lo -MD -MP -MF .de
ps/md5.Tpo -c md5.c -fno-common -DPIC -o .libs/md5.o
md5.c:50:6: warning: #warning Undetermined or unsupported Byte Order...
We will try LITTLE_ENDIAN
and
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -I/opt/local/include -I
../common -g -O2 -Wall -Wformat -Wformat-security -fstack-protector-all
-fstack-protector -D_FORTIFY_SOURCE=2 -MT sha1.lo -MD -MP -MF .d
eps/sha1.Tpo -c sha1.c -fno-common -DPIC -o .libs/sha1.o
sha1.c:127:6: warning: #warning Undetermined or unsupported Byte
Order... We will try LITTLE_ENDIAN
I got the same warnings with 2.5-pre1.
I recalled that PPC is big endian so hacked the below patch in and was
able to get fwknop to work. I wouldn't use the patch for a good commit,
as it doesn't support 64-bit PPC systems and its duplicated across two
files.
I also suggest making a missing BYTEORDER define a compile error instead
of just a warning.
Looks like autoconf provides AC_C_BIGENDIAN, but I don't think that
provides enough information, as lib/sha1.c uses different code for
BYTEORDER of 1234, 4321, 12345678 and 87654321.
Blair
diff -ru ../fwknop-2.0.4.orig/lib/md5.c ./lib/md5.c
--- ../fwknop-2.0.4.orig/lib/md5.c 2012-12-09 12:55:59.000000000 -0800
+++ ./lib/md5.c 2013-06-09 15:08:13.000000000 -0700
@@ -29,6 +29,12 @@
*/
#include "md5.h"
+#ifndef BYTEORDER
+#ifdef __ppc__
+#define BYTEORDER 4321
+#endif
+#endif
+
#if BYTEORDER == 1234
#define byteReverse(buf, len) /* Nothing */
#elif BYTEORDER == 4321
diff -ru ../fwknop-2.0.4.orig/lib/sha1.c ./lib/sha1.c
--- ../fwknop-2.0.4.orig/lib/sha1.c 2012-12-09 12:55:59.000000000 -0800
+++ ./lib/sha1.c 2013-06-09 15:08:59.000000000 -0700
@@ -72,6 +72,12 @@
#undef SWAP_DONE
+#ifndef BYTEORDER
+#ifdef __ppc__
+#define BYTEORDER 4321
+#endif
+#endif
+
#if BYTEORDER == 1234
#define SWAP_DONE
for (i = 0; i < 16; ++i) {
------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. A cloud service to automate IT design, transition and operations
2. Dashboards that offer high-level views of enterprise services
3. A single system of record for all IT processes
http://p.sf.net/sfu/servicenow-d2d-j
_______________________________________________
Fwknop-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fwknop-discuss