compat-wireless: backport sk_add_backlog() calls through a patch
authorLuis R. Rodriguez <lrodriguez@atheros.com>
Tue, 13 Jul 2010 22:32:38 +0000 (15:32 -0700)
committerLuis R. Rodriguez <lrodriguez@atheros.com>
Tue, 13 Jul 2010 22:39:10 +0000 (15:39 -0700)
v2.6.34-rc2~48 got 8eae939f net: add limit for socket backlog
This adds sk_add_backlog_limitted() which makes the backlog
have a size, and therefore adding an skb to the backlog can
fail, a later patch changed all non-limitted calls to use the
limitted caller via a3a858ff. The older kernels don't have a
size and as such always are successfull when adding to the
backlog.

An overload is possible but complex in C so just backport this
via a patch. This fixes this compile issue with compat-wireless
when on kernels older than 2.6.34:

 CC [M]  /home/philipp/kernel/build_i586/compat-wireless-2010-07-12/net/bluetooth/l2cap.o
/home/philipp/kernel/build_i586/compat-wireless-2010-07-12/net/bluetooth/l2cap.c: In function 'l2cap_data_channel':
/home/philipp/kernel/build_i586/compat-wireless-2010-07-12/net/bluetooth/l2cap.c:4352: error: void value not ignored as it ought to be
make[4]: *** [/home/philipp/kernel/build_i586/compat-wireless-2010-07-12/net/bluetooth/l2cap.o] Error 1
make[3]: *** [/home/philipp/kernel/build_i586/compat-wireless-2010-07-12/net/bluetooth] Error 2
make[2]: *** [_module_/home/philipp/kernel/build_i586/compat-wireless-2010-07-12] Error 2
make[2]: Leaving directory `/home/philipp/kernel/build_i586/linux-2.6.27.48-astlinux'
make[1]: *** [modules] Error 2
make[1]: Leaving directory `/home/philipp/kernel/build_i586/compat-wireless-2010-07-12'
make: *** [/home/philipp/kernel/build_i586/compat-wireless-2010-07-12/net/wireless/lib80211.ko] Error 2

Reported-by: "Philip A. Prindeville" <philipp_subx@redfish-solutions.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
patches/31-backport-sk_add_backlog.patch [new file with mode: 0644]

diff --git a/patches/31-backport-sk_add_backlog.patch b/patches/31-backport-sk_add_backlog.patch
new file mode 100644 (file)
index 0000000..2cd4e9f
--- /dev/null
@@ -0,0 +1,24 @@
+
+v2.6.34-rc2~48 got 8eae939f net: add limit for socket backlog
+This adds sk_add_backlog_limitted() which makes the backlog
+have a size, and therefore adding an skb to the backlog can
+fail, a later patch changed all non-limitted calls to use the
+limitted caller via a3a858ff. The older kernels don't have a
+size and as such always are successfull when adding to the
+backlog.
+
+--- a/net/bluetooth/l2cap.c
++++ b/net/bluetooth/l2cap.c
+@@ -4349,8 +4349,12 @@ static inline int l2cap_data_channel(str
+               if (!sock_owned_by_user(sk)) {
+                       l2cap_ertm_data_rcv(sk, skb);
+               } else {
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34))
+                       if (sk_add_backlog(sk, skb))
+                               goto drop;
++#else
++                      sk_add_backlog(sk, skb);
++#endif
+               }
+               goto done;