From: Johannes Berg Date: Thu, 7 Mar 2013 20:36:01 +0000 (-0800) Subject: compat-drivers: netlink_callback min_dump_alloc only exists since 3.1 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=db0e9cad45c9199cf14ae5b9d78d8dd6697d7860;p=openwrt%2Fstaging%2Fblogic.git compat-drivers: netlink_callback min_dump_alloc only exists since 3.1 The netlink callback min_dump_alloc only exists on kernel 3.1 so only enable using it for those kernels. If you're on an older 64-bit kernel and want this functionality of resizing the data sent to userspace for a wiphy dump then you better upgrade. Signed-off-by: Johannes Berg Signed-off-by: Luis R. Rodriguez --- diff --git a/patches/collateral-evolutions/network/70-disable-dump-adjust-on-old-kernels.patch b/patches/collateral-evolutions/network/70-disable-dump-adjust-on-old-kernels.patch new file mode 100644 index 000000000000..a1c1250b1930 --- /dev/null +++ b/patches/collateral-evolutions/network/70-disable-dump-adjust-on-old-kernels.patch @@ -0,0 +1,21 @@ +On older kernels, we can't do this workaround, so if you use +an old 64-bit kernel with compat you'd better upgrade. + +--- a/net/wireless/nl80211.c ++++ b/net/wireless/nl80211.c +@@ -1321,6 +1321,7 @@ static int nl80211_dump_wiphy(struct sk_ + cb->nlh->nlmsg_seq, NLM_F_MULTI, + dev); + if (ret < 0) { ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0) + /* + * If sending the wiphy data didn't fit (ENOBUFS or + * EMSGSIZE returned), this SKB is still empty (so +@@ -1340,6 +1341,7 @@ static int nl80211_dump_wiphy(struct sk_ + mutex_unlock(&cfg80211_mutex); + return 1; + } ++#endif + idx--; + break; + }