Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 351431
b: refs/heads/master
c: c2a9366
h: refs/heads/master
i:
  351429: 72848a5
  351427: ce7c84b
  351423: 7bbeb2a
v: v3
  • Loading branch information
Jesper Dangaard Brouer authored and David S. Miller committed Jan 17, 2013
1 parent 970e80b commit 553e711
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d59577b6ffd313d0ab3be39cb1ab47e29bdc9182
refs/heads/master: c2a936600f78aea00d3312ea4b66a79a4619f9b4
4 changes: 2 additions & 2 deletions trunk/include/net/ipv6.h
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,8 @@ static inline int ip6_frag_mem(struct net *net)
}
#endif

#define IPV6_FRAG_HIGH_THRESH (256 * 1024) /* 262144 */
#define IPV6_FRAG_LOW_THRESH (192 * 1024) /* 196608 */
#define IPV6_FRAG_HIGH_THRESH (4 * 1024*1024) /* 4194304 */
#define IPV6_FRAG_LOW_THRESH (3 * 1024*1024) /* 3145728 */
#define IPV6_FRAG_TIMEOUT (60 * HZ) /* 60 seconds */

extern int __ipv6_addr_type(const struct in6_addr *addr);
Expand Down
22 changes: 15 additions & 7 deletions trunk/net/ipv4/ip_fragment.c
Original file line number Diff line number Diff line change
Expand Up @@ -851,14 +851,22 @@ static inline void ip4_frags_ctl_register(void)

static int __net_init ipv4_frags_init_net(struct net *net)
{
/*
* Fragment cache limits. We will commit 256K at one time. Should we
* cross that limit we will prune down to 192K. This should cope with
* even the most extreme cases without allowing an attacker to
* measurably harm machine performance.
/* Fragment cache limits.
*
* The fragment memory accounting code, (tries to) account for
* the real memory usage, by measuring both the size of frag
* queue struct (inet_frag_queue (ipv4:ipq/ipv6:frag_queue))
* and the SKB's truesize.
*
* A 64K fragment consumes 129736 bytes (44*2944)+200
* (1500 truesize == 2944, sizeof(struct ipq) == 200)
*
* We will commit 4MB at one time. Should we cross that limit
* we will prune down to 3MB, making room for approx 8 big 64K
* fragments 8x128k.
*/
net->ipv4.frags.high_thresh = 256 * 1024;
net->ipv4.frags.low_thresh = 192 * 1024;
net->ipv4.frags.high_thresh = 4 * 1024 * 1024;
net->ipv4.frags.low_thresh = 3 * 1024 * 1024;
/*
* Important NOTE! Fragment queue must be destroyed before MSL expires.
* RFC791 is wrong proposing to prolongate timer each fragment arrival
Expand Down

0 comments on commit 553e711

Please sign in to comment.