Репозиторий Sisyphus
Последнее обновление: 20 октября 2020 | Пакетов: 17712 | Посещений: 19439244
en ru br
Репозитории ALT

Группа :: Система/Библиотеки
Пакет: iptables-ratelimit

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: iptables-ratelimit-0.3-alt1.patch
Скачать


 .gear/rules                                        |  3 +
 .../tags/2ce32e8af9c23734b8487782c2f23c60d5294dd8  | 22 +++++++
 .gear/tags/list                                    |  1 +
 iptables-ratelimit.spec                            | 67 ++++++++++++++++++++++
 xt_ratelimit.c                                     |  3 +-
 5 files changed, 94 insertions(+), 2 deletions(-)
diff --git a/.gear/rules b/.gear/rules
new file mode 100644
index 0000000..bcbac63
--- /dev/null
+++ b/.gear/rules
@@ -0,0 +1,3 @@
+spec: iptables-ratelimit.spec
+tar: v@version@:.
+diff: v@version@:. .
diff --git a/.gear/tags/2ce32e8af9c23734b8487782c2f23c60d5294dd8 b/.gear/tags/2ce32e8af9c23734b8487782c2f23c60d5294dd8
new file mode 100644
index 0000000..cadbbed
--- /dev/null
+++ b/.gear/tags/2ce32e8af9c23734b8487782c2f23c60d5294dd8
@@ -0,0 +1,22 @@
+object 1fdbe9889bdd110e028f57ce4751a89842783606
+type commit
+tag v0.3
+tagger Alexei Takaseev <taf@altlinux.org> 1495507433 +0800
+
+v0.3
+-----BEGIN PGP SIGNATURE-----
+
+iQIcBAABAgAGBQJZI6HpAAoJEOHGC4YauSQ2iEMP/227pZxXwrzcxafRfNtlc4v4
+MWf4Yj6vDXvspnEDdN0fokW2PhOPNcIuVgVS8Ow+N/1nm64rj8Tgsc0CQoT2QKYu
+H0DjJ/2Oi3rV0pa1rOcXc8mryWZsXbFZDgLMKnPa3jrWmjMGlc3wCauJ03jqiXTw
+pt/+8S+9jdsCtc89Z+9PzjWCece3/t+vrEJI6gQUVS/VtPtSmZHy7mW74f5SP2/N
+8PofzNgaUJAIQweYu83vrREF+tj4KXI9qKlDWuTDGJOj6O3bL6GlvGXOe1Qd+Z67
+k1EZdk6XxGFjt62DIloNDD6TfG21dgh2Ns+s0rGGTWKhhN4EoZkYu1UF5slWGGwv
+ZRxLGACEFeFWRhcgLpSsJYGt473NUYEhPrBFwvWx8fSeK4mwIkHLbtDnYB6L3zBC
+TMG+qk3ptnsMmFUt2n/QLpRjr5aIJvY7gcoMcU3NbKTHdvCVvdw3c/UjXx9ZlJqD
+bw+5mix+0KsJv80hBhcga/Bz/fmm9LrNvwbo7uZW3zrzTkIn2JPHZfmBOD+gxDyW
+asJCAaWBWSdZUeGGyBL8EwumMlkhY4WHQc9ype3eIFAUOAbD5oLJG3Mqy9ncOjZ4
+Sc/DV5qzNRjqbOfTPYPdBQMV07Urs1xHaaYK0c2ibNxiSMv2XcnOPmI33PbDtS+M
+1Tnr8qX/nCqpr/EAnD4l
+=mOcr
+-----END PGP SIGNATURE-----
diff --git a/.gear/tags/list b/.gear/tags/list
new file mode 100644
index 0000000..6a15d00
--- /dev/null
+++ b/.gear/tags/list
@@ -0,0 +1 @@
+2ce32e8af9c23734b8487782c2f23c60d5294dd8 v0.3
diff --git a/iptables-ratelimit.spec b/iptables-ratelimit.spec
new file mode 100644
index 0000000..5c67a50
--- /dev/null
+++ b/iptables-ratelimit.spec
@@ -0,0 +1,67 @@
+Name: iptables-ratelimit
+Version: 0.3
+Release: alt1
+Summary: ipt-ratelimit module implements traffic policing
+Group: System/Libraries
+
+Packager: Alexei Takaseev <taf@altlinux.ru>
+
+License: GPLv2
+Url: https://github.com/aabc/ipt-ratelimit
+Source0: %name-%version.tar
+Patch0: %name-%version-%release.patch
+
+BuildRequires: iptables-devel
+BuildPreReq: rpm-build-kernel
+
+%description
+ipt-ratelimit module implements traffic policing (i.e. limiting traffic bit
+rate) using, standard for this purpose, token bucket filter (TBF) algorithm.
+Particular implementation is based on FreeBSD's implementation of Cisco's TBF
+with extended burst value (which is used to implement RED-like drop
+behavior)
+
+%package -n kernel-source-%name
+Summary: Kernel module for ipt-ratelimit
+License: GPLv2
+Group: Development/Kernel
+BuildArch: noarch
+
+%description -n kernel-source-%name
+Provide ipt-ratelimit kernel module
+
+
+%prep
+%setup
+%patch0 -p1
+tar -cjf ../%name-%version.tar.bz2 ../%name-%version
+
+%build
+
+make libxt_ratelimit.so
+
+%install
+make linstall DESTDIR=%buildroot
+
+mkdir -p %kernel_srcdir
+install -pDm0644 ../%name-%version.tar.bz2 %kernel_srcdir/%name-%version.tar.bz2
+
+%files
+%doc CREDITS NEWS README
+/%_lib/iptables/*.so
+
+%files -n kernel-source-%name
+%attr(0644,root,root) %kernel_src/%name-%version.tar.bz2
+
+%changelog
+* Tue May 23 2017 Alexei Takaseev <taf@altlinux.org> 0.3-alt1
+- 0.3
+
+* Mon Nov 16 2015 Alexei Takaseev <taf@altlinux.org> 0.2-alt1
+- 0.2
+
+* Sun Sep 27 2015 Alexei Takaseev <taf@altlinux.org> 0.1-alt2
+- fix compilation for kernels > 3.18
+
+* Fri Sep 25 2015 Alexei Takaseev <taf@altlinux.org> 0.1-alt1
+- Initial RPM release
diff --git a/xt_ratelimit.c b/xt_ratelimit.c
index 04d14d9..ba22368 100644
--- a/xt_ratelimit.c
+++ b/xt_ratelimit.c
@@ -179,8 +179,7 @@ unsigned long calc_rate_est(const struct ratelimit_stat *stat)
 	{
 		const unsigned int slot_delta_rtime = RATEST_JIFFIES - (now % RATEST_JIFFIES);
 #define SMOOTH_VAUE 10 /* smoothen integer arithmetics */
-		const unsigned int prev_ratio = (slot_delta_rtime)?
-			RATEST_JIFFIES * SMOOTH_VAUE / slot_delta_rtime : SMOOTH_VAUE;
+		const unsigned int prev_ratio = RATEST_JIFFIES * SMOOTH_VAUE / slot_delta_rtime;
 
 		bps = bps * SMOOTH_VAUE / prev_ratio;
 		bps += cur_bytes;
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin