From: Xi Wang Date: Fri, 16 Dec 2011 12:44:15 +0000 (+0000) Subject: sctp: fix incorrect overflow check on autoclose X-Git-Tag: v3.2-rc7~12^2~7 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2692ba61a82203404abd7dd2a027bda962861f74;hp=2692ba61a82203404abd7dd2a027bda962861f74;p=pandora-kernel.git sctp: fix incorrect overflow check on autoclose Commit 8ffd3208 voids the previous patches f6778aab and 810c0719 for limiting the autoclose value. If userspace passes in -1 on 32-bit platform, the overflow check didn't work and autoclose would be set to 0xffffffff. This patch defines a max_autoclose (in seconds) for limiting the value and exposes it through sysctl, with the following intentions. 1) Avoid overflowing autoclose * HZ. 2) Keep the default autoclose bound consistent across 32- and 64-bit platforms (INT_MAX / HZ in this patch). 3) Keep the autoclose value consistent between setsockopt() and getsockopt() calls. Suggested-by: Vlad Yasevich Signed-off-by: Xi Wang Signed-off-by: David S. Miller ---