summaryrefslogtreecommitdiff
path: root/usr.sbin/hostapd/hostapd.c
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2005-07-04 16:48:56 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2005-07-04 16:48:56 +0000
commit03a3758e2d3fc5580e2243cdcd781c3cb117838b (patch)
treef5542ec35fa7600032adbc1be10475ccd71bfacd /usr.sbin/hostapd/hostapd.c
parent9c9b8fd0b9980abb67022628753d92ad25c851a1 (diff)
add 'random' action address and auth open request/response
Diffstat (limited to 'usr.sbin/hostapd/hostapd.c')
-rw-r--r--usr.sbin/hostapd/hostapd.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/usr.sbin/hostapd/hostapd.c b/usr.sbin/hostapd/hostapd.c
index e7dabf43f51..0e9d74857b1 100644
--- a/usr.sbin/hostapd/hostapd.c
+++ b/usr.sbin/hostapd/hostapd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hostapd.c,v 1.11 2005/06/17 19:13:35 reyk Exp $ */
+/* $OpenBSD: hostapd.c,v 1.12 2005/07/04 16:48:55 reyk Exp $ */
/*
* Copyright (c) 2004, 2005 Reyk Floeter <reyk@vantronix.net>
@@ -494,6 +494,20 @@ main(int argc, char *argv[])
return (EXIT_SUCCESS);
}
+void
+hostapd_randval(u_int8_t *buf, const u_int len)
+{
+ u_int32_t data = 0;
+ u_int i;
+
+ for (i = 0; i < len; i++) {
+ if ((i % sizeof(data)) == 0)
+ data = arc4random();
+ buf[i] = data & 0xff;
+ data >>= 8;
+ }
+}
+
struct hostapd_table *
hostapd_table_add(struct hostapd_config *cfg, const char *name)
{