diff options
Diffstat (limited to 'net/ipv4/ip_fragment.c')
| -rw-r--r-- | net/ipv4/ip_fragment.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c index da734c439179..74046efdf875 100644 --- a/net/ipv4/ip_fragment.c +++ b/net/ipv4/ip_fragment.c | |||
| @@ -23,7 +23,6 @@ | |||
| 23 | */ | 23 | */ |
| 24 | 24 | ||
| 25 | #include <linux/compiler.h> | 25 | #include <linux/compiler.h> |
| 26 | #include <linux/config.h> | ||
| 27 | #include <linux/module.h> | 26 | #include <linux/module.h> |
| 28 | #include <linux/types.h> | 27 | #include <linux/types.h> |
| 29 | #include <linux/mm.h> | 28 | #include <linux/mm.h> |
| @@ -55,15 +54,15 @@ | |||
| 55 | * even the most extreme cases without allowing an attacker to measurably | 54 | * even the most extreme cases without allowing an attacker to measurably |
| 56 | * harm machine performance. | 55 | * harm machine performance. |
| 57 | */ | 56 | */ |
| 58 | int sysctl_ipfrag_high_thresh = 256*1024; | 57 | int sysctl_ipfrag_high_thresh __read_mostly = 256*1024; |
| 59 | int sysctl_ipfrag_low_thresh = 192*1024; | 58 | int sysctl_ipfrag_low_thresh __read_mostly = 192*1024; |
| 60 | 59 | ||
| 61 | int sysctl_ipfrag_max_dist = 64; | 60 | int sysctl_ipfrag_max_dist __read_mostly = 64; |
| 62 | 61 | ||
| 63 | /* Important NOTE! Fragment queue must be destroyed before MSL expires. | 62 | /* Important NOTE! Fragment queue must be destroyed before MSL expires. |
| 64 | * RFC791 is wrong proposing to prolongate timer each fragment arrival by TTL. | 63 | * RFC791 is wrong proposing to prolongate timer each fragment arrival by TTL. |
| 65 | */ | 64 | */ |
| 66 | int sysctl_ipfrag_time = IP_FRAG_TIME; | 65 | int sysctl_ipfrag_time __read_mostly = IP_FRAG_TIME; |
| 67 | 66 | ||
| 68 | struct ipfrag_skb_cb | 67 | struct ipfrag_skb_cb |
| 69 | { | 68 | { |
| @@ -78,9 +77,9 @@ struct ipq { | |||
| 78 | struct hlist_node list; | 77 | struct hlist_node list; |
| 79 | struct list_head lru_list; /* lru list member */ | 78 | struct list_head lru_list; /* lru list member */ |
| 80 | u32 user; | 79 | u32 user; |
| 81 | u32 saddr; | 80 | __be32 saddr; |
| 82 | u32 daddr; | 81 | __be32 daddr; |
| 83 | u16 id; | 82 | __be16 id; |
| 84 | u8 protocol; | 83 | u8 protocol; |
| 85 | u8 last_in; | 84 | u8 last_in; |
| 86 | #define COMPLETE 4 | 85 | #define COMPLETE 4 |
| @@ -124,14 +123,15 @@ static __inline__ void ipq_unlink(struct ipq *ipq) | |||
| 124 | write_unlock(&ipfrag_lock); | 123 | write_unlock(&ipfrag_lock); |
| 125 | } | 124 | } |
| 126 | 125 | ||
| 127 | static unsigned int ipqhashfn(u16 id, u32 saddr, u32 daddr, u8 prot) | 126 | static unsigned int ipqhashfn(__be16 id, __be32 saddr, __be32 daddr, u8 prot) |
| 128 | { | 127 | { |
| 129 | return jhash_3words((u32)id << 16 | prot, saddr, daddr, | 128 | return jhash_3words((__force u32)id << 16 | prot, |
| 129 | (__force u32)saddr, (__force u32)daddr, | ||
| 130 | ipfrag_hash_rnd) & (IPQ_HASHSZ - 1); | 130 | ipfrag_hash_rnd) & (IPQ_HASHSZ - 1); |
| 131 | } | 131 | } |
| 132 | 132 | ||
| 133 | static struct timer_list ipfrag_secret_timer; | 133 | static struct timer_list ipfrag_secret_timer; |
| 134 | int sysctl_ipfrag_secret_interval = 10 * 60 * HZ; | 134 | int sysctl_ipfrag_secret_interval __read_mostly = 10 * 60 * HZ; |
| 135 | 135 | ||
| 136 | static void ipfrag_secret_rebuild(unsigned long dummy) | 136 | static void ipfrag_secret_rebuild(unsigned long dummy) |
| 137 | { | 137 | { |
| @@ -388,8 +388,8 @@ out_nomem: | |||
| 388 | static inline struct ipq *ip_find(struct iphdr *iph, u32 user) | 388 | static inline struct ipq *ip_find(struct iphdr *iph, u32 user) |
| 389 | { | 389 | { |
| 390 | __be16 id = iph->id; | 390 | __be16 id = iph->id; |
| 391 | __u32 saddr = iph->saddr; | 391 | __be32 saddr = iph->saddr; |
| 392 | __u32 daddr = iph->daddr; | 392 | __be32 daddr = iph->daddr; |
| 393 | __u8 protocol = iph->protocol; | 393 | __u8 protocol = iph->protocol; |
| 394 | unsigned int hash; | 394 | unsigned int hash; |
| 395 | struct ipq *qp; | 395 | struct ipq *qp; |
| @@ -666,7 +666,7 @@ static struct sk_buff *ip_frag_reasm(struct ipq *qp, struct net_device *dev) | |||
| 666 | head->len += fp->len; | 666 | head->len += fp->len; |
| 667 | if (head->ip_summed != fp->ip_summed) | 667 | if (head->ip_summed != fp->ip_summed) |
| 668 | head->ip_summed = CHECKSUM_NONE; | 668 | head->ip_summed = CHECKSUM_NONE; |
| 669 | else if (head->ip_summed == CHECKSUM_HW) | 669 | else if (head->ip_summed == CHECKSUM_COMPLETE) |
| 670 | head->csum = csum_add(head->csum, fp->csum); | 670 | head->csum = csum_add(head->csum, fp->csum); |
| 671 | head->truesize += fp->truesize; | 671 | head->truesize += fp->truesize; |
| 672 | atomic_sub(fp->truesize, &ip_frag_mem); | 672 | atomic_sub(fp->truesize, &ip_frag_mem); |
