projects
/
deliverable
/
linux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[NET/IPV4/IPV6]: Change some sysctl variables to __read_mostly
[deliverable/linux.git]
/
net
/
ipv4
/
ip_fragment.c
diff --git
a/net/ipv4/ip_fragment.c
b/net/ipv4/ip_fragment.c
index ce2b70ce4018dffdbb6842ad6b47129f5209a75c..165d72859ddf4cbe7d49bb49ecafb739b0001806 100644
(file)
--- a/
net/ipv4/ip_fragment.c
+++ b/
net/ipv4/ip_fragment.c
@@
-23,7
+23,6
@@
*/
#include <linux/compiler.h>
*/
#include <linux/compiler.h>
-#include <linux/config.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/mm.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/mm.h>
@@
-55,15
+54,15
@@
* even the most extreme cases without allowing an attacker to measurably
* harm machine performance.
*/
* even the most extreme cases without allowing an attacker to measurably
* harm machine performance.
*/
-int sysctl_ipfrag_high_thresh = 256*1024;
-int sysctl_ipfrag_low_thresh = 192*1024;
+int sysctl_ipfrag_high_thresh
__read_mostly
= 256*1024;
+int sysctl_ipfrag_low_thresh
__read_mostly
= 192*1024;
-int sysctl_ipfrag_max_dist = 64;
+int sysctl_ipfrag_max_dist
__read_mostly
= 64;
/* Important NOTE! Fragment queue must be destroyed before MSL expires.
* RFC791 is wrong proposing to prolongate timer each fragment arrival by TTL.
*/
/* Important NOTE! Fragment queue must be destroyed before MSL expires.
* RFC791 is wrong proposing to prolongate timer each fragment arrival by TTL.
*/
-int sysctl_ipfrag_time = IP_FRAG_TIME;
+int sysctl_ipfrag_time
__read_mostly
= IP_FRAG_TIME;
struct ipfrag_skb_cb
{
struct ipfrag_skb_cb
{
@@
-131,7
+130,7
@@
static unsigned int ipqhashfn(u16 id, u32 saddr, u32 daddr, u8 prot)
}
static struct timer_list ipfrag_secret_timer;
}
static struct timer_list ipfrag_secret_timer;
-int sysctl_ipfrag_secret_interval = 10 * 60 * HZ;
+int sysctl_ipfrag_secret_interval
__read_mostly
= 10 * 60 * HZ;
static void ipfrag_secret_rebuild(unsigned long dummy)
{
static void ipfrag_secret_rebuild(unsigned long dummy)
{
@@
-304,13
+303,17
@@
out:
/* Creation primitives. */
/* Creation primitives. */
-static struct ipq *ip_frag_intern(
unsigned int hash,
struct ipq *qp_in)
+static struct ipq *ip_frag_intern(struct ipq *qp_in)
{
struct ipq *qp;
#ifdef CONFIG_SMP
struct hlist_node *n;
#endif
{
struct ipq *qp;
#ifdef CONFIG_SMP
struct hlist_node *n;
#endif
+ unsigned int hash;
+
write_lock(&ipfrag_lock);
write_lock(&ipfrag_lock);
+ hash = ipqhashfn(qp_in->id, qp_in->saddr, qp_in->daddr,
+ qp_in->protocol);
#ifdef CONFIG_SMP
/* With SMP race we have to recheck hash table, because
* such entry could be created on other cpu, while we
#ifdef CONFIG_SMP
/* With SMP race we have to recheck hash table, because
* such entry could be created on other cpu, while we
@@
-345,7
+348,7
@@
static struct ipq *ip_frag_intern(unsigned int hash, struct ipq *qp_in)
}
/* Add an entry to the 'ipq' queue for a newly received IP datagram. */
}
/* Add an entry to the 'ipq' queue for a newly received IP datagram. */
-static struct ipq *ip_frag_create(
unsigned hash,
struct iphdr *iph, u32 user)
+static struct ipq *ip_frag_create(struct iphdr *iph, u32 user)
{
struct ipq *qp;
{
struct ipq *qp;
@@
-371,7
+374,7
@@
static struct ipq *ip_frag_create(unsigned hash, struct iphdr *iph, u32 user)
spin_lock_init(&qp->lock);
atomic_set(&qp->refcnt, 1);
spin_lock_init(&qp->lock);
atomic_set(&qp->refcnt, 1);
- return ip_frag_intern(
hash,
qp);
+ return ip_frag_intern(qp);
out_nomem:
LIMIT_NETDEBUG(KERN_ERR "ip_frag_create: no memory left !\n");
out_nomem:
LIMIT_NETDEBUG(KERN_ERR "ip_frag_create: no memory left !\n");
@@
-383,15
+386,16
@@
out_nomem:
*/
static inline struct ipq *ip_find(struct iphdr *iph, u32 user)
{
*/
static inline struct ipq *ip_find(struct iphdr *iph, u32 user)
{
- __
u
16 id = iph->id;
+ __
be
16 id = iph->id;
__u32 saddr = iph->saddr;
__u32 daddr = iph->daddr;
__u8 protocol = iph->protocol;
__u32 saddr = iph->saddr;
__u32 daddr = iph->daddr;
__u8 protocol = iph->protocol;
- unsigned int hash
= ipqhashfn(id, saddr, daddr, protocol)
;
+ unsigned int hash;
struct ipq *qp;
struct hlist_node *n;
read_lock(&ipfrag_lock);
struct ipq *qp;
struct hlist_node *n;
read_lock(&ipfrag_lock);
+ hash = ipqhashfn(id, saddr, daddr, protocol);
hlist_for_each_entry(qp, n, &ipq_hash[hash], list) {
if(qp->id == id &&
qp->saddr == saddr &&
hlist_for_each_entry(qp, n, &ipq_hash[hash], list) {
if(qp->id == id &&
qp->saddr == saddr &&
@@
-405,7
+409,7
@@
static inline struct ipq *ip_find(struct iphdr *iph, u32 user)
}
read_unlock(&ipfrag_lock);
}
read_unlock(&ipfrag_lock);
- return ip_frag_create(
hash,
iph, user);
+ return ip_frag_create(iph, user);
}
/* Is the fragment too far ahead to be part of ipq? */
}
/* Is the fragment too far ahead to be part of ipq? */
@@
-661,7
+665,7
@@
static struct sk_buff *ip_frag_reasm(struct ipq *qp, struct net_device *dev)
head->len += fp->len;
if (head->ip_summed != fp->ip_summed)
head->ip_summed = CHECKSUM_NONE;
head->len += fp->len;
if (head->ip_summed != fp->ip_summed)
head->ip_summed = CHECKSUM_NONE;
- else if (head->ip_summed == CHECKSUM_
HW
)
+ else if (head->ip_summed == CHECKSUM_
COMPLETE
)
head->csum = csum_add(head->csum, fp->csum);
head->truesize += fp->truesize;
atomic_sub(fp->truesize, &ip_frag_mem);
head->csum = csum_add(head->csum, fp->csum);
head->truesize += fp->truesize;
atomic_sub(fp->truesize, &ip_frag_mem);
This page took
0.025365 seconds
and
5
git commands to generate.