aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/net/inet_frag.h11
-rw-r--r--include/net/ipv6.h4
-rw-r--r--net/ieee802154/reassembly.c14
-rw-r--r--net/ipv4/ip_fragment.c14
-rw-r--r--net/ipv6/netfilter/nf_conntrack_reasm.c2
-rw-r--r--net/ipv6/reassembly.c14
6 files changed, 30 insertions, 29 deletions
diff --git a/include/net/inet_frag.h b/include/net/inet_frag.h
index 6f59de98dabd..15033057d44e 100644
--- a/include/net/inet_frag.h
+++ b/include/net/inet_frag.h
@@ -71,10 +71,11 @@ struct inet_frags {
71 u32 rnd; 71 u32 rnd;
72 int qsize; 72 int qsize;
73 73
74 unsigned int (*hashfn)(struct inet_frag_queue *); 74 unsigned int (*hashfn)(const struct inet_frag_queue *);
75 bool (*match)(struct inet_frag_queue *q, void *arg); 75 bool (*match)(const struct inet_frag_queue *q,
76 const void *arg);
76 void (*constructor)(struct inet_frag_queue *q, 77 void (*constructor)(struct inet_frag_queue *q,
77 void *arg); 78 const void *arg);
78 void (*destructor)(struct inet_frag_queue *); 79 void (*destructor)(struct inet_frag_queue *);
79 void (*skb_free)(struct sk_buff *); 80 void (*skb_free)(struct sk_buff *);
80 void (*frag_expire)(unsigned long data); 81 void (*frag_expire)(unsigned long data);
@@ -131,9 +132,9 @@ static inline void init_frag_mem_limit(struct netns_frags *nf)
131 percpu_counter_init(&nf->mem, 0); 132 percpu_counter_init(&nf->mem, 0);
132} 133}
133 134
134static inline int sum_frag_mem_limit(struct netns_frags *nf) 135static inline unsigned int sum_frag_mem_limit(struct netns_frags *nf)
135{ 136{
136 int res; 137 unsigned int res;
137 138
138 local_bh_disable(); 139 local_bh_disable();
139 res = percpu_counter_sum_positive(&nf->mem); 140 res = percpu_counter_sum_positive(&nf->mem);
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index a25017247457..25c2170e1298 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -496,8 +496,8 @@ struct ip6_create_arg {
496 u8 ecn; 496 u8 ecn;
497}; 497};
498 498
499void ip6_frag_init(struct inet_frag_queue *q, void *a); 499void ip6_frag_init(struct inet_frag_queue *q, const void *a);
500bool ip6_frag_match(struct inet_frag_queue *q, void *a); 500bool ip6_frag_match(const struct inet_frag_queue *q, const void *a);
501 501
502/* 502/*
503 * Equivalent of ipv4 struct ip 503 * Equivalent of ipv4 struct ip
diff --git a/net/ieee802154/reassembly.c b/net/ieee802154/reassembly.c
index b85bd3f7048e..a5588be18024 100644
--- a/net/ieee802154/reassembly.c
+++ b/net/ieee802154/reassembly.c
@@ -61,18 +61,18 @@ static unsigned int lowpan_hash_frag(__be16 tag, u16 d_size,
61 return c & (INETFRAGS_HASHSZ - 1); 61 return c & (INETFRAGS_HASHSZ - 1);
62} 62}
63 63
64static unsigned int lowpan_hashfn(struct inet_frag_queue *q) 64static unsigned int lowpan_hashfn(const struct inet_frag_queue *q)
65{ 65{
66 struct lowpan_frag_queue *fq; 66 const struct lowpan_frag_queue *fq;
67 67
68 fq = container_of(q, struct lowpan_frag_queue, q); 68 fq = container_of(q, struct lowpan_frag_queue, q);
69 return lowpan_hash_frag(fq->tag, fq->d_size, &fq->saddr, &fq->daddr); 69 return lowpan_hash_frag(fq->tag, fq->d_size, &fq->saddr, &fq->daddr);
70} 70}
71 71
72static bool lowpan_frag_match(struct inet_frag_queue *q, void *a) 72static bool lowpan_frag_match(const struct inet_frag_queue *q, const void *a)
73{ 73{
74 struct lowpan_frag_queue *fq; 74 const struct lowpan_frag_queue *fq;
75 struct lowpan_create_arg *arg = a; 75 const struct lowpan_create_arg *arg = a;
76 76
77 fq = container_of(q, struct lowpan_frag_queue, q); 77 fq = container_of(q, struct lowpan_frag_queue, q);
78 return fq->tag == arg->tag && fq->d_size == arg->d_size && 78 return fq->tag == arg->tag && fq->d_size == arg->d_size &&
@@ -80,10 +80,10 @@ static bool lowpan_frag_match(struct inet_frag_queue *q, void *a)
80 ieee802154_addr_equal(&fq->daddr, arg->dst); 80 ieee802154_addr_equal(&fq->daddr, arg->dst);
81} 81}
82 82
83static void lowpan_frag_init(struct inet_frag_queue *q, void *a) 83static void lowpan_frag_init(struct inet_frag_queue *q, const void *a)
84{ 84{
85 const struct lowpan_create_arg *arg = a;
85 struct lowpan_frag_queue *fq; 86 struct lowpan_frag_queue *fq;
86 struct lowpan_create_arg *arg = a;
87 87
88 fq = container_of(q, struct lowpan_frag_queue, q); 88 fq = container_of(q, struct lowpan_frag_queue, q);
89 89
diff --git a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c
index ed32313e307c..586e6aaf9e6e 100644
--- a/net/ipv4/ip_fragment.c
+++ b/net/ipv4/ip_fragment.c
@@ -112,18 +112,18 @@ static unsigned int ipqhashfn(__be16 id, __be32 saddr, __be32 daddr, u8 prot)
112 ip4_frags.rnd) & (INETFRAGS_HASHSZ - 1); 112 ip4_frags.rnd) & (INETFRAGS_HASHSZ - 1);
113} 113}
114 114
115static unsigned int ip4_hashfn(struct inet_frag_queue *q) 115static unsigned int ip4_hashfn(const struct inet_frag_queue *q)
116{ 116{
117 struct ipq *ipq; 117 const struct ipq *ipq;
118 118
119 ipq = container_of(q, struct ipq, q); 119 ipq = container_of(q, struct ipq, q);
120 return ipqhashfn(ipq->id, ipq->saddr, ipq->daddr, ipq->protocol); 120 return ipqhashfn(ipq->id, ipq->saddr, ipq->daddr, ipq->protocol);
121} 121}
122 122
123static bool ip4_frag_match(struct inet_frag_queue *q, void *a) 123static bool ip4_frag_match(const struct inet_frag_queue *q, const void *a)
124{ 124{
125 struct ipq *qp; 125 const struct ipq *qp;
126 struct ip4_create_arg *arg = a; 126 const struct ip4_create_arg *arg = a;
127 127
128 qp = container_of(q, struct ipq, q); 128 qp = container_of(q, struct ipq, q);
129 return qp->id == arg->iph->id && 129 return qp->id == arg->iph->id &&
@@ -133,14 +133,14 @@ static bool ip4_frag_match(struct inet_frag_queue *q, void *a)
133 qp->user == arg->user; 133 qp->user == arg->user;
134} 134}
135 135
136static void ip4_frag_init(struct inet_frag_queue *q, void *a) 136static void ip4_frag_init(struct inet_frag_queue *q, const void *a)
137{ 137{
138 struct ipq *qp = container_of(q, struct ipq, q); 138 struct ipq *qp = container_of(q, struct ipq, q);
139 struct netns_ipv4 *ipv4 = container_of(q->net, struct netns_ipv4, 139 struct netns_ipv4 *ipv4 = container_of(q->net, struct netns_ipv4,
140 frags); 140 frags);
141 struct net *net = container_of(ipv4, struct net, ipv4); 141 struct net *net = container_of(ipv4, struct net, ipv4);
142 142
143 struct ip4_create_arg *arg = a; 143 const struct ip4_create_arg *arg = a;
144 144
145 qp->protocol = arg->iph->protocol; 145 qp->protocol = arg->iph->protocol;
146 qp->id = arg->iph->id; 146 qp->id = arg->iph->id;
diff --git a/net/ipv6/netfilter/nf_conntrack_reasm.c b/net/ipv6/netfilter/nf_conntrack_reasm.c
index 0d5279fd852a..c2c3f2116bc5 100644
--- a/net/ipv6/netfilter/nf_conntrack_reasm.c
+++ b/net/ipv6/netfilter/nf_conntrack_reasm.c
@@ -156,7 +156,7 @@ static unsigned int nf_hash_frag(__be32 id, const struct in6_addr *saddr,
156} 156}
157 157
158 158
159static unsigned int nf_hashfn(struct inet_frag_queue *q) 159static unsigned int nf_hashfn(const struct inet_frag_queue *q)
160{ 160{
161 const struct frag_queue *nq; 161 const struct frag_queue *nq;
162 162
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c
index cc85a9ba5010..0c6932cc08cb 100644
--- a/net/ipv6/reassembly.c
+++ b/net/ipv6/reassembly.c
@@ -94,18 +94,18 @@ static unsigned int inet6_hash_frag(__be32 id, const struct in6_addr *saddr,
94 return c & (INETFRAGS_HASHSZ - 1); 94 return c & (INETFRAGS_HASHSZ - 1);
95} 95}
96 96
97static unsigned int ip6_hashfn(struct inet_frag_queue *q) 97static unsigned int ip6_hashfn(const struct inet_frag_queue *q)
98{ 98{
99 struct frag_queue *fq; 99 const struct frag_queue *fq;
100 100
101 fq = container_of(q, struct frag_queue, q); 101 fq = container_of(q, struct frag_queue, q);
102 return inet6_hash_frag(fq->id, &fq->saddr, &fq->daddr); 102 return inet6_hash_frag(fq->id, &fq->saddr, &fq->daddr);
103} 103}
104 104
105bool ip6_frag_match(struct inet_frag_queue *q, void *a) 105bool ip6_frag_match(const struct inet_frag_queue *q, const void *a)
106{ 106{
107 struct frag_queue *fq; 107 const struct frag_queue *fq;
108 struct ip6_create_arg *arg = a; 108 const struct ip6_create_arg *arg = a;
109 109
110 fq = container_of(q, struct frag_queue, q); 110 fq = container_of(q, struct frag_queue, q);
111 return fq->id == arg->id && 111 return fq->id == arg->id &&
@@ -115,10 +115,10 @@ bool ip6_frag_match(struct inet_frag_queue *q, void *a)
115} 115}
116EXPORT_SYMBOL(ip6_frag_match); 116EXPORT_SYMBOL(ip6_frag_match);
117 117
118void ip6_frag_init(struct inet_frag_queue *q, void *a) 118void ip6_frag_init(struct inet_frag_queue *q, const void *a)
119{ 119{
120 struct frag_queue *fq = container_of(q, struct frag_queue, q); 120 struct frag_queue *fq = container_of(q, struct frag_queue, q);
121 struct ip6_create_arg *arg = a; 121 const struct ip6_create_arg *arg = a;
122 122
123 fq->id = arg->id; 123 fq->id = arg->id;
124 fq->user = arg->user; 124 fq->user = arg->user;