diff options
Diffstat (limited to 'net/ieee80211/softmac/ieee80211softmac_auth.c')
-rw-r--r-- | net/ieee80211/softmac/ieee80211softmac_auth.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/net/ieee80211/softmac/ieee80211softmac_auth.c b/net/ieee80211/softmac/ieee80211softmac_auth.c index 2ae1833b657a..6012705aa4f8 100644 --- a/net/ieee80211/softmac/ieee80211softmac_auth.c +++ b/net/ieee80211/softmac/ieee80211softmac_auth.c | |||
@@ -161,7 +161,7 @@ ieee80211softmac_auth_resp(struct net_device *dev, struct ieee80211_auth *auth) | |||
161 | /* Make sure that we've got an auth queue item for this request */ | 161 | /* Make sure that we've got an auth queue item for this request */ |
162 | if(aq == NULL) | 162 | if(aq == NULL) |
163 | { | 163 | { |
164 | printkl(KERN_DEBUG PFX "Authentication response received from "MAC_FMT" but no queue item exists.\n", MAC_ARG(auth->header.addr2)); | 164 | dprintkl(KERN_DEBUG PFX "Authentication response received from "MAC_FMT" but no queue item exists.\n", MAC_ARG(auth->header.addr2)); |
165 | /* Error #? */ | 165 | /* Error #? */ |
166 | return -1; | 166 | return -1; |
167 | } | 167 | } |
@@ -169,7 +169,7 @@ ieee80211softmac_auth_resp(struct net_device *dev, struct ieee80211_auth *auth) | |||
169 | /* Check for out of order authentication */ | 169 | /* Check for out of order authentication */ |
170 | if(!net->authenticating) | 170 | if(!net->authenticating) |
171 | { | 171 | { |
172 | printkl(KERN_DEBUG PFX "Authentication response received from "MAC_FMT" but did not request authentication.\n",MAC_ARG(auth->header.addr2)); | 172 | dprintkl(KERN_DEBUG PFX "Authentication response received from "MAC_FMT" but did not request authentication.\n",MAC_ARG(auth->header.addr2)); |
173 | return -1; | 173 | return -1; |
174 | } | 174 | } |
175 | 175 | ||
@@ -219,10 +219,16 @@ ieee80211softmac_auth_resp(struct net_device *dev, struct ieee80211_auth *auth) | |||
219 | net->challenge_len = *data++; | 219 | net->challenge_len = *data++; |
220 | if (net->challenge_len > WLAN_AUTH_CHALLENGE_LEN) | 220 | if (net->challenge_len > WLAN_AUTH_CHALLENGE_LEN) |
221 | net->challenge_len = WLAN_AUTH_CHALLENGE_LEN; | 221 | net->challenge_len = WLAN_AUTH_CHALLENGE_LEN; |
222 | if (net->challenge != NULL) | 222 | kfree(net->challenge); |
223 | kfree(net->challenge); | 223 | net->challenge = kmemdup(data, net->challenge_len, |
224 | net->challenge = kmalloc(net->challenge_len, GFP_ATOMIC); | 224 | GFP_ATOMIC); |
225 | memcpy(net->challenge, data, net->challenge_len); | 225 | if (net->challenge == NULL) { |
226 | printkl(KERN_NOTICE PFX "Shared Key " | ||
227 | "Authentication failed due to " | ||
228 | "memory shortage.\n"); | ||
229 | spin_unlock_irqrestore(&mac->lock, flags); | ||
230 | break; | ||
231 | } | ||
226 | aq->state = IEEE80211SOFTMAC_AUTH_SHARED_RESPONSE; | 232 | aq->state = IEEE80211SOFTMAC_AUTH_SHARED_RESPONSE; |
227 | 233 | ||
228 | /* We reuse the work struct from the auth request here. | 234 | /* We reuse the work struct from the auth request here. |
@@ -345,7 +351,7 @@ ieee80211softmac_deauth_req(struct ieee80211softmac_device *mac, | |||
345 | /* Make sure the network is authenticated */ | 351 | /* Make sure the network is authenticated */ |
346 | if (!net->authenticated) | 352 | if (!net->authenticated) |
347 | { | 353 | { |
348 | printkl(KERN_DEBUG PFX "Can't send deauthentication packet, network is not authenticated.\n"); | 354 | dprintkl(KERN_DEBUG PFX "Can't send deauthentication packet, network is not authenticated.\n"); |
349 | /* Error okay? */ | 355 | /* Error okay? */ |
350 | return -EPERM; | 356 | return -EPERM; |
351 | } | 357 | } |
@@ -379,7 +385,7 @@ ieee80211softmac_deauth_resp(struct net_device *dev, struct ieee80211_deauth *de | |||
379 | net = ieee80211softmac_get_network_by_bssid(mac, deauth->header.addr2); | 385 | net = ieee80211softmac_get_network_by_bssid(mac, deauth->header.addr2); |
380 | 386 | ||
381 | if (net == NULL) { | 387 | if (net == NULL) { |
382 | printkl(KERN_DEBUG PFX "Received deauthentication packet from "MAC_FMT", but that network is unknown.\n", | 388 | dprintkl(KERN_DEBUG PFX "Received deauthentication packet from "MAC_FMT", but that network is unknown.\n", |
383 | MAC_ARG(deauth->header.addr2)); | 389 | MAC_ARG(deauth->header.addr2)); |
384 | return 0; | 390 | return 0; |
385 | } | 391 | } |
@@ -387,7 +393,7 @@ ieee80211softmac_deauth_resp(struct net_device *dev, struct ieee80211_deauth *de | |||
387 | /* Make sure the network is authenticated */ | 393 | /* Make sure the network is authenticated */ |
388 | if(!net->authenticated) | 394 | if(!net->authenticated) |
389 | { | 395 | { |
390 | printkl(KERN_DEBUG PFX "Can't perform deauthentication, network is not authenticated.\n"); | 396 | dprintkl(KERN_DEBUG PFX "Can't perform deauthentication, network is not authenticated.\n"); |
391 | /* Error okay? */ | 397 | /* Error okay? */ |
392 | return -EPERM; | 398 | return -EPERM; |
393 | } | 399 | } |