From 7ad5350dfb47b92052201f9eb8c3257af6800bfc Mon Sep 17 00:00:00 2001
From: Jo-Philipp Wich <jow@openwrt.org>
Date: Tue, 12 Nov 2013 11:01:11 +0000
Subject: [PATCH] Add patch to fix ipset timeout setting problem

Fixes #14325

Signed-off-by: Nikolay Martynov <mar.kolya@gmail.com>

SVN-Revision: 38779
---
 .../ipset/patches/001-timeout-size.patch      | 28 +++++++++++++++++++
 1 file changed, 28 insertions(+)
 create mode 100644 package/network/utils/ipset/patches/001-timeout-size.patch

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;
+ }
-- 
GitLab