GIT.Harvie.CZ
/
svn
/
Prometheus-QoS
/
.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
simple iptables based packet limiter to deflect DoS attacks on our clients
[svn/Prometheus-QoS/.git]
/
parsehosts.c
diff --git
a/parsehosts.c
b/parsehosts.c
index ac9b39fd47c374f23c965bb159f3223c2648258c..5014ffb8287cb168d2c6b5df709745ddb25eff7d 100644
(file)
--- a/
parsehosts.c
+++ b/
parsehosts.c
@@
-40,6
+40,7
@@
void TheIP(char *ipaddr, int is_network)
ip->direct = \
\r
ip->traffic = \
\r
ip->pktsup = \
\r
ip->direct = \
\r
ip->traffic = \
\r
ip->pktsup = \
\r
+ ip->pps_limit = \
\r
ip->pktsdown = 0;
\r
ip->keyword = keywords;
\r
ip->v6 = (strchr(ip->addr,':')!=NULL);
\r
ip->pktsdown = 0;
\r
ip->keyword = keywords;
\r
ip->v6 = (strchr(ip->addr,':')!=NULL);
\r
@@
-252,12
+253,14
@@
void parse_hosts(char *hosts)
else
\r
{
\r
ip->max -= ip->keyword->reserve_max;
\r
else
\r
{
\r
ip->max -= ip->keyword->reserve_max;
\r
- if(ip->max
<
ip->min)
\r
+ if(ip->max
<
ip->min)
\r
{
\r
{
\r
- ip->max
=
ip->min;
\r
+ ip->max
=
ip->min;
\r
}
\r
}
\r
}
\r
}
\r
-
\r
+
\r
+ /* MTU is 1450 bytes = 11600 bits ~= 12 kbit, max is in kb/s */
\r
+ ip->pps_limit = ip->max/12;
\r
ip->mark = FIRSTIPCLASS+1+class_count++;
\r
update_network(ip->addr, ip);
\r
\r
ip->mark = FIRSTIPCLASS+1+class_count++;
\r
update_network(ip->addr, ip);
\r
\r
This page took
0.102101 seconds
and
4
git commands to generate.