aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/net/xfrm.h8
-rw-r--r--net/ipv4/ah4.c2
-rw-r--r--net/ipv4/esp4.c2
-rw-r--r--net/ipv4/ipcomp.c2
-rw-r--r--net/ipv4/xfrm4_tunnel.c2
-rw-r--r--net/ipv6/ah6.c2
-rw-r--r--net/ipv6/esp6.c2
-rw-r--r--net/ipv6/ipcomp6.c2
-rw-r--r--net/ipv6/mip6.c4
-rw-r--r--net/ipv6/xfrm6_tunnel.c2
-rw-r--r--net/xfrm/xfrm_state.c16
11 files changed, 22 insertions, 22 deletions
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 34d373775a0e..ac72116636ca 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -202,7 +202,7 @@ struct xfrm_state
202 202
203 /* Reference to data common to all the instances of this 203 /* Reference to data common to all the instances of this
204 * transformer. */ 204 * transformer. */
205 struct xfrm_type *type; 205 const struct xfrm_type *type;
206 struct xfrm_mode *inner_mode; 206 struct xfrm_mode *inner_mode;
207 struct xfrm_mode *outer_mode; 207 struct xfrm_mode *outer_mode;
208 208
@@ -279,7 +279,7 @@ struct xfrm_state_afinfo {
279 unsigned int proto; 279 unsigned int proto;
280 unsigned int eth_proto; 280 unsigned int eth_proto;
281 struct module *owner; 281 struct module *owner;
282 struct xfrm_type *type_map[IPPROTO_MAX]; 282 const struct xfrm_type *type_map[IPPROTO_MAX];
283 struct xfrm_mode *mode_map[XFRM_MODE_MAX]; 283 struct xfrm_mode *mode_map[XFRM_MODE_MAX];
284 int (*init_flags)(struct xfrm_state *x); 284 int (*init_flags)(struct xfrm_state *x);
285 void (*init_tempsel)(struct xfrm_state *x, struct flowi *fl, 285 void (*init_tempsel)(struct xfrm_state *x, struct flowi *fl,
@@ -322,8 +322,8 @@ struct xfrm_type
322 u32 (*get_mtu)(struct xfrm_state *, int size); 322 u32 (*get_mtu)(struct xfrm_state *, int size);
323}; 323};
324 324
325extern int xfrm_register_type(struct xfrm_type *type, unsigned short family); 325extern int xfrm_register_type(const struct xfrm_type *type, unsigned short family);
326extern int xfrm_unregister_type(struct xfrm_type *type, unsigned short family); 326extern int xfrm_unregister_type(const struct xfrm_type *type, unsigned short family);
327 327
328struct xfrm_mode { 328struct xfrm_mode {
329 /* 329 /*
diff --git a/net/ipv4/ah4.c b/net/ipv4/ah4.c
index d76803a3dcae..9d4555ec0b59 100644
--- a/net/ipv4/ah4.c
+++ b/net/ipv4/ah4.c
@@ -300,7 +300,7 @@ static void ah_destroy(struct xfrm_state *x)
300} 300}
301 301
302 302
303static struct xfrm_type ah_type = 303static const struct xfrm_type ah_type =
304{ 304{
305 .description = "AH4", 305 .description = "AH4",
306 .owner = THIS_MODULE, 306 .owner = THIS_MODULE,
diff --git a/net/ipv4/esp4.c b/net/ipv4/esp4.c
index fac4f102c9f9..258d17631b4b 100644
--- a/net/ipv4/esp4.c
+++ b/net/ipv4/esp4.c
@@ -600,7 +600,7 @@ error:
600 return err; 600 return err;
601} 601}
602 602
603static struct xfrm_type esp_type = 603static const struct xfrm_type esp_type =
604{ 604{
605 .description = "ESP4", 605 .description = "ESP4",
606 .owner = THIS_MODULE, 606 .owner = THIS_MODULE,
diff --git a/net/ipv4/ipcomp.c b/net/ipv4/ipcomp.c
index b79cdbee68a9..ae1f45fc23b9 100644
--- a/net/ipv4/ipcomp.c
+++ b/net/ipv4/ipcomp.c
@@ -437,7 +437,7 @@ error:
437 goto out; 437 goto out;
438} 438}
439 439
440static struct xfrm_type ipcomp_type = { 440static const struct xfrm_type ipcomp_type = {
441 .description = "IPCOMP4", 441 .description = "IPCOMP4",
442 .owner = THIS_MODULE, 442 .owner = THIS_MODULE,
443 .proto = IPPROTO_COMP, 443 .proto = IPPROTO_COMP,
diff --git a/net/ipv4/xfrm4_tunnel.c b/net/ipv4/xfrm4_tunnel.c
index 326845195620..87f77e412ba2 100644
--- a/net/ipv4/xfrm4_tunnel.c
+++ b/net/ipv4/xfrm4_tunnel.c
@@ -38,7 +38,7 @@ static void ipip_destroy(struct xfrm_state *x)
38{ 38{
39} 39}
40 40
41static struct xfrm_type ipip_type = { 41static const struct xfrm_type ipip_type = {
42 .description = "IPIP", 42 .description = "IPIP",
43 .owner = THIS_MODULE, 43 .owner = THIS_MODULE,
44 .proto = IPPROTO_IPIP, 44 .proto = IPPROTO_IPIP,
diff --git a/net/ipv6/ah6.c b/net/ipv6/ah6.c
index fb0d07a15e93..379c8e04c36c 100644
--- a/net/ipv6/ah6.c
+++ b/net/ipv6/ah6.c
@@ -515,7 +515,7 @@ static void ah6_destroy(struct xfrm_state *x)
515 kfree(ahp); 515 kfree(ahp);
516} 516}
517 517
518static struct xfrm_type ah6_type = 518static const struct xfrm_type ah6_type =
519{ 519{
520 .description = "AH6", 520 .description = "AH6",
521 .owner = THIS_MODULE, 521 .owner = THIS_MODULE,
diff --git a/net/ipv6/esp6.c b/net/ipv6/esp6.c
index ca48c56c4b17..8e0f1428c716 100644
--- a/net/ipv6/esp6.c
+++ b/net/ipv6/esp6.c
@@ -538,7 +538,7 @@ error:
538 return err; 538 return err;
539} 539}
540 540
541static struct xfrm_type esp6_type = 541static const struct xfrm_type esp6_type =
542{ 542{
543 .description = "ESP6", 543 .description = "ESP6",
544 .owner = THIS_MODULE, 544 .owner = THIS_MODULE,
diff --git a/net/ipv6/ipcomp6.c b/net/ipv6/ipcomp6.c
index 710325e7a842..b90039593a7f 100644
--- a/net/ipv6/ipcomp6.c
+++ b/net/ipv6/ipcomp6.c
@@ -453,7 +453,7 @@ error:
453 goto out; 453 goto out;
454} 454}
455 455
456static struct xfrm_type ipcomp6_type = 456static const struct xfrm_type ipcomp6_type =
457{ 457{
458 .description = "IPCOMP6", 458 .description = "IPCOMP6",
459 .owner = THIS_MODULE, 459 .owner = THIS_MODULE,
diff --git a/net/ipv6/mip6.c b/net/ipv6/mip6.c
index 49d396620eac..cd8a5bda13cd 100644
--- a/net/ipv6/mip6.c
+++ b/net/ipv6/mip6.c
@@ -330,7 +330,7 @@ static void mip6_destopt_destroy(struct xfrm_state *x)
330{ 330{
331} 331}
332 332
333static struct xfrm_type mip6_destopt_type = 333static const struct xfrm_type mip6_destopt_type =
334{ 334{
335 .description = "MIP6DESTOPT", 335 .description = "MIP6DESTOPT",
336 .owner = THIS_MODULE, 336 .owner = THIS_MODULE,
@@ -462,7 +462,7 @@ static void mip6_rthdr_destroy(struct xfrm_state *x)
462{ 462{
463} 463}
464 464
465static struct xfrm_type mip6_rthdr_type = 465static const struct xfrm_type mip6_rthdr_type =
466{ 466{
467 .description = "MIP6RT", 467 .description = "MIP6RT",
468 .owner = THIS_MODULE, 468 .owner = THIS_MODULE,
diff --git a/net/ipv6/xfrm6_tunnel.c b/net/ipv6/xfrm6_tunnel.c
index fae90ff31087..639fe8a6ff1e 100644
--- a/net/ipv6/xfrm6_tunnel.c
+++ b/net/ipv6/xfrm6_tunnel.c
@@ -319,7 +319,7 @@ static void xfrm6_tunnel_destroy(struct xfrm_state *x)
319 xfrm6_tunnel_free_spi((xfrm_address_t *)&x->props.saddr); 319 xfrm6_tunnel_free_spi((xfrm_address_t *)&x->props.saddr);
320} 320}
321 321
322static struct xfrm_type xfrm6_tunnel_type = { 322static const struct xfrm_type xfrm6_tunnel_type = {
323 .description = "IP6IP6", 323 .description = "IP6IP6",
324 .owner = THIS_MODULE, 324 .owner = THIS_MODULE,
325 .proto = IPPROTO_IPV6, 325 .proto = IPPROTO_IPV6,
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
index 3003503d0c94..4463eeb8d1de 100644
--- a/net/xfrm/xfrm_state.c
+++ b/net/xfrm/xfrm_state.c
@@ -216,10 +216,10 @@ static void xfrm_state_unlock_afinfo(struct xfrm_state_afinfo *afinfo)
216 write_unlock_bh(&xfrm_state_afinfo_lock); 216 write_unlock_bh(&xfrm_state_afinfo_lock);
217} 217}
218 218
219int xfrm_register_type(struct xfrm_type *type, unsigned short family) 219int xfrm_register_type(const struct xfrm_type *type, unsigned short family)
220{ 220{
221 struct xfrm_state_afinfo *afinfo = xfrm_state_lock_afinfo(family); 221 struct xfrm_state_afinfo *afinfo = xfrm_state_lock_afinfo(family);
222 struct xfrm_type **typemap; 222 const struct xfrm_type **typemap;
223 int err = 0; 223 int err = 0;
224 224
225 if (unlikely(afinfo == NULL)) 225 if (unlikely(afinfo == NULL))
@@ -235,10 +235,10 @@ int xfrm_register_type(struct xfrm_type *type, unsigned short family)
235} 235}
236EXPORT_SYMBOL(xfrm_register_type); 236EXPORT_SYMBOL(xfrm_register_type);
237 237
238int xfrm_unregister_type(struct xfrm_type *type, unsigned short family) 238int xfrm_unregister_type(const struct xfrm_type *type, unsigned short family)
239{ 239{
240 struct xfrm_state_afinfo *afinfo = xfrm_state_lock_afinfo(family); 240 struct xfrm_state_afinfo *afinfo = xfrm_state_lock_afinfo(family);
241 struct xfrm_type **typemap; 241 const struct xfrm_type **typemap;
242 int err = 0; 242 int err = 0;
243 243
244 if (unlikely(afinfo == NULL)) 244 if (unlikely(afinfo == NULL))
@@ -254,11 +254,11 @@ int xfrm_unregister_type(struct xfrm_type *type, unsigned short family)
254} 254}
255EXPORT_SYMBOL(xfrm_unregister_type); 255EXPORT_SYMBOL(xfrm_unregister_type);
256 256
257static struct xfrm_type *xfrm_get_type(u8 proto, unsigned short family) 257static const struct xfrm_type *xfrm_get_type(u8 proto, unsigned short family)
258{ 258{
259 struct xfrm_state_afinfo *afinfo; 259 struct xfrm_state_afinfo *afinfo;
260 struct xfrm_type **typemap; 260 const struct xfrm_type **typemap;
261 struct xfrm_type *type; 261 const struct xfrm_type *type;
262 int modload_attempted = 0; 262 int modload_attempted = 0;
263 263
264retry: 264retry:
@@ -281,7 +281,7 @@ retry:
281 return type; 281 return type;
282} 282}
283 283
284static void xfrm_put_type(struct xfrm_type *type) 284static void xfrm_put_type(const struct xfrm_type *type)
285{ 285{
286 module_put(type->owner); 286 module_put(type->owner);
287} 287}