openbsd-ports/security/aircrack-ng/patches/patch-src_airserv-ng_c

57 lines
1.8 KiB
Plaintext
Raw Normal View History

$OpenBSD: patch-src_airserv-ng_c,v 1.1.1.1 2009/05/06 20:39:29 kili Exp $
--- src/airserv-ng.c.orig Thu Mar 26 22:01:02 2009
+++ src/airserv-ng.c Wed Apr 15 18:33:39 2009
@@ -35,14 +35,6 @@
#include <stdarg.h>
#include <signal.h>
-#ifdef __MACH__
-#include <libkern/OSByteOrder.h>
-#elif defined(__FreeBSD__)
-#include <machine/endian.h>
-#else
-#include <asm/byteorder.h>
-#endif /* __MACH__ */
-
#include "osdep/osdep.h"
#include "osdep/network.h"
#include "version.h"
@@ -442,31 +434,12 @@ static void handle_card(struct sstate *ss)
if (rd >= 0)
rd += sizeof(*ri);
-#ifdef __MACH__
- ri->ri_mactime = OSSwapHostToBigInt64(ri->ri_mactime);
- ri->ri_power = OSSwapHostToBigInt32(ri->ri_power);
- ri->ri_noise = OSSwapHostToBigInt32(ri->ri_noise);
- ri->ri_channel = OSSwapHostToBigInt32(ri->ri_channel);
- ri->ri_rate = OSSwapHostToBigInt32(ri->ri_rate);
- ri->ri_antenna = OSSwapHostToBigInt32(ri->ri_antenna);
-
-#elif defined(__FreeBSD__)
-#if BYTE_ORDER == BIG_ENDIAN
-# define __be32_to_cpu(x) (x)
-# define __be64_to_cpu(x) (x)
-#elif BYTE_ORDER == LITTLE_ENDIAN
-# define __be32_to_cpu(x) __bswap32(x)
-# define __be64_to_cpu(x) __bswap64(x)
-#endif
-
-#else
- ri->ri_mactime = __cpu_to_be64(ri->ri_mactime);
- ri->ri_power = __cpu_to_be32(ri->ri_power);
- ri->ri_noise = __cpu_to_be32(ri->ri_noise);
- ri->ri_channel = __cpu_to_be32(ri->ri_channel);
- ri->ri_rate = __cpu_to_be32(ri->ri_rate);
- ri->ri_antenna = __cpu_to_be32(ri->ri_antenna);
-#endif /* __MACH__ */
+ ri->ri_mactime = aircrack_htonl64(ri->ri_mactime);
+ ri->ri_power = htonl(ri->ri_power);
+ ri->ri_noise = htonl(ri->ri_noise);
+ ri->ri_channel = htonl(ri->ri_channel);
+ ri->ri_rate = htonl(ri->ri_rate);
+ ri->ri_antenna = htonl(ri->ri_antenna);
c = ss->ss_clients.c_next;
while (c != &ss->ss_clients) {