aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2013-11-12 11:01:11 +0000
committerJo-Philipp Wich <jow@openwrt.org>2013-11-12 11:01:11 +0000
commit77bc939d2c8fafdcf39d56e7c53c2ec00bd9eda5 (patch)
tree8a659f182a657d6dab082ad1c000c5d5c083febf
parent3a19342a087d753af49b97d80cf88c7ed04c15a9 (diff)
downloadupstream-77bc939d2c8fafdcf39d56e7c53c2ec00bd9eda5.tar.gz
upstream-77bc939d2c8fafdcf39d56e7c53c2ec00bd9eda5.tar.bz2
upstream-77bc939d2c8fafdcf39d56e7c53c2ec00bd9eda5.zip
Add patch to fix ipset timeout setting problem
Fixes #14325 Signed-off-by: Nikolay Martynov <mar.kolya@gmail.com> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@38779 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r--package/network/utils/ipset/patches/001-timeout-size.patch28
1 files changed, 28 insertions, 0 deletions
diff --git a/package/network/utils/ipset/patches/001-timeout-size.patch b/package/network/utils/ipset/patches/001-timeout-size.patch
new file mode 100644
index 0000000000..b9ff4e256d
--- /dev/null
+++ b/package/network/utils/ipset/patches/001-timeout-size.patch
@@ -0,0 +1,28 @@
+diff --git a/lib/parse.c b/lib/parse.c
+index 8ea8542..440ef8f 100644
+--- a/lib/parse.c
++++ b/lib/parse.c
+@@ -1292,15 +1292,20 @@ ipset_parse_timeout(struct ipset_session *session,
+ enum ipset_opt opt, const char *str)
+ {
+ int err;
+- unsigned long long num = 0;
++ unsigned long long llnum = 0;
++ uint32_t num = 0;
+
+ assert(session);
+ assert(opt == IPSET_OPT_TIMEOUT);
+ assert(str);
+
+- err = string_to_number_ll(session, str, 0, UINT_MAX/1000, &num);
+- if (err == 0)
++ err = string_to_number_ll(session, str, 0, UINT_MAX/1000, &llnum);
++ if (err == 0) {
++ /* Timeout is expected to be 32bits wide, so we have
++ to convert it here */
++ num = llnum;
+ return ipset_session_data_set(session, opt, &num);
++ }
+
+ return err;
+ }