From 002b1b34b3de9b263c6382c1cde1d44b6d4807ae Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Wed, 13 Jan 2010 22:29:04 +0100 Subject: [PATCH] compat-wireless: missing ksize export ksize is used two times now in net/wireless/scan.c This changes the check into false, if the kernel does not export ksize. Signed-off-by: Hauke Mehrtens --- patches/02-ksize.patch | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/patches/02-ksize.patch b/patches/02-ksize.patch index 013c0b4764de..726fa2b0bb24 100644 --- a/patches/02-ksize.patch +++ b/patches/02-ksize.patch @@ -12,16 +12,33 @@ of the situation. --- a/net/wireless/scan.c +++ b/net/wireless/scan.c -@@ -423,7 +423,12 @@ cfg80211_bss_update(struct cfg80211_regi +@@ -424,9 +424,14 @@ cfg80211_bss_update(struct cfg80211_regi size_t used = dev->wiphy.bss_priv_size + sizeof(*res); - size_t ielen = res->pub.len_information_elements; + size_t ielen = res->pub.len_proberesp_ies; +#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,28) + if (0) { + used = 0; /* just to shut up the compiler */ +#else - if (!found->ies_allocated && ksize(found) >= used + ielen) { + if (found->pub.proberesp_ies && + !found->proberesp_ies_allocated && + ksize(found) >= used + ielen) { +#endif - memcpy(found->pub.information_elements, - res->pub.information_elements, ielen); - found->pub.len_information_elements = ielen; + memcpy(found->pub.proberesp_ies, + res->pub.proberesp_ies, ielen); + found->pub.len_proberesp_ies = ielen; +@@ -457,9 +462,14 @@ cfg80211_bss_update(struct cfg80211_regi + size_t used = dev->wiphy.bss_priv_size + sizeof(*res); + size_t ielen = res->pub.len_beacon_ies; + ++#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,28) ++ if (0) { ++ used = 0; /* just to shut up the compiler */ ++#else + if (found->pub.beacon_ies && + !found->beacon_ies_allocated && + ksize(found) >= used + ielen) { ++#endif + memcpy(found->pub.beacon_ies, + res->pub.beacon_ies, ielen); + found->pub.len_beacon_ies = ielen; -- 2.30.2