diff options
author | Damien Bergamini <damien@cvs.openbsd.org> | 2009-01-26 21:55:59 +0000 |
---|---|---|
committer | Damien Bergamini <damien@cvs.openbsd.org> | 2009-01-26 21:55:59 +0000 |
commit | fbcefd4a9b43719f72cdcb48271957a443d17f86 (patch) | |
tree | 780c3f408d0752ab99c3e002604f0c1b49a3f5f8 /sys/net80211/ieee80211_node.c | |
parent | 67ccd880dc761238fd9795e851f035e239c77a6a (diff) |
move ni_macaddr field at the top of the ieee80211_node structure.
this way we can avoid putting a full node structure (which is huge)
on the stack in ieee80211_find_node().
this is a bit tricky but the RB_FIND macro wants an "elem" structure,
not a field of "elem".
Diffstat (limited to 'sys/net80211/ieee80211_node.c')
-rw-r--r-- | sys/net80211/ieee80211_node.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c index 7cc051cb2d9..4f43cd26ffe 100644 --- a/sys/net80211/ieee80211_node.c +++ b/sys/net80211/ieee80211_node.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ieee80211_node.c,v 1.50 2009/01/26 19:09:41 damien Exp $ */ +/* $OpenBSD: ieee80211_node.c,v 1.51 2009/01/26 21:55:58 damien Exp $ */ /* $NetBSD: ieee80211_node.c,v 1.14 2004/05/09 09:18:47 dyoung Exp $ */ /*- @@ -810,10 +810,9 @@ ieee80211_dup_bss(struct ieee80211com *ic, const u_int8_t *macaddr) struct ieee80211_node * ieee80211_find_node(struct ieee80211com *ic, const u_int8_t *macaddr) { - struct ieee80211_node ni; - - IEEE80211_ADDR_COPY(ni.ni_macaddr, macaddr); - return (RB_FIND(ieee80211_tree, &ic->ic_tree, &ni)); + /* XXX ugly, but avoids a full node structure in the stack */ + return (RB_FIND(ieee80211_tree, &ic->ic_tree, + (struct ieee80211_node *)macaddr)); } /* |