summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorStefan Sperling <stsp@cvs.openbsd.org>2012-07-16 14:51:32 +0000
committerStefan Sperling <stsp@cvs.openbsd.org>2012-07-16 14:51:32 +0000
commit55f7f71177514bb7e1460945961f21c3c23cceb9 (patch)
treec8671b167a61127d9ef6923f263b27fcefb2df11 /sys
parent7db54c324cea827a60c84973931dac9b26b718d5 (diff)
Fix a couple of possible node leaks in ieee80211_input().
Diffstat (limited to 'sys')
-rw-r--r--sys/net80211/ieee80211_input.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/sys/net80211/ieee80211_input.c b/sys/net80211/ieee80211_input.c
index 62e220d5418..eb0e739fbef 100644
--- a/sys/net80211/ieee80211_input.c
+++ b/sys/net80211/ieee80211_input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ieee80211_input.c,v 1.120 2012/07/13 11:25:04 stsp Exp $ */
+/* $OpenBSD: ieee80211_input.c,v 1.121 2012/07/16 14:51:31 stsp Exp $ */
/*-
* Copyright (c) 2001 Atsushi Onoe
@@ -401,7 +401,9 @@ ieee80211_input(struct ifnet *ifp, struct mbuf *m, struct ieee80211_node *ni,
DPRINTF(("data from unknown src %s\n",
ether_sprintf(wh->i_addr2)));
/* NB: caller deals with reference */
- ni = ieee80211_dup_bss(ic, wh->i_addr2);
+ ni = ieee80211_find_node(ic, wh->i_addr2);
+ if (ni == NULL)
+ ni = ieee80211_dup_bss(ic, wh->i_addr2);
if (ni != NULL) {
IEEE80211_SEND_MGMT(ic, ni,
IEEE80211_FC0_SUBTYPE_DEAUTH,
@@ -1725,7 +1727,9 @@ ieee80211_recv_probe_req(struct ieee80211com *ic, struct mbuf *m,
}
if (ni == ic->ic_bss) {
- ni = ieee80211_dup_bss(ic, wh->i_addr2);
+ ni = ieee80211_find_node(ic, wh->i_addr2);
+ if (ni == NULL)
+ ni = ieee80211_dup_bss(ic, wh->i_addr2);
if (ni == NULL)
return;
DPRINTF(("new probe req from %s\n",
@@ -1905,7 +1909,9 @@ ieee80211_recv_assoc_req(struct ieee80211com *ic, struct mbuf *m,
DPRINTF(("deny %sassoc from %s, not authenticated\n",
reassoc ? "re" : "",
ether_sprintf((u_int8_t *)wh->i_addr2)));
- ni = ieee80211_dup_bss(ic, wh->i_addr2);
+ ni = ieee80211_find_node(ic, wh->i_addr2);
+ if (ni == NULL)
+ ni = ieee80211_dup_bss(ic, wh->i_addr2);
if (ni != NULL) {
IEEE80211_SEND_MGMT(ic, ni,
IEEE80211_FC0_SUBTYPE_DEAUTH,