Works correctly on any endian now. Checked with x86 and my ar71xx router.
Also, I've tried to workaround GCC 4.2/3 bug. Funny even older GCC 3 used for mips work fine
http://rghost.ru/50248390 - kms_linux_src_2.zip
Couldn't test your big endian fixes but the diffs show you made the right changes.
gcc 4.2.3 doesn't know optimize("1") and shows rpc.c:132: warning: 'optimize' attribute directive ignored. However it works perfectly with -O2, -O3 and -Os.
Changing to
works without warning and limits fix to 4.0, 4.1, 4.2 and 4.3.Code:// Workaround for buggy GCC 4.2/4.3
#if __GNUC__ == 4 && __GNUC_MINOR__ < 4 //#if __GNUC__ < 4 || __GNUC_MINOR__ < 4 (small bug in condition)
__attribute__((noinline))
#endif
static void MakeHmacKey(void *ts, unsigned long long *key)
{
PUT_UA64LE( key,
( GET_UA64LE(ts) / 0x00000022816889BDULL ) * 0x000000208CBAB5EDULL + 0x3156CD5AC628477AULL );
}
brcm or ar71xx build
http://rghost.ru/50248281 - big-endian, just tested to work on my router.
http://rghost.ru/50248316 - little-endian, built with tomato toolchain, have no device to test on, but little-endian on x86 works.

