xfrm: constify mark argument of xfrm_find_acq()
authorMathias Krause <minipli@googlemail.com>
Wed, 26 Jun 2013 21:56:58 +0000 (23:56 +0200)
committerSteffen Klassert <steffen.klassert@secunet.com>
Mon, 5 Aug 2013 09:13:53 +0000 (11:13 +0200)
The mark argument is read only, so constify it. Also make dummy_mark in
af_key const -- only used as dummy argument for this very function.

Signed-off-by: Mathias Krause <minipli@googlemail.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
include/net/xfrm.h
net/key/af_key.c
net/xfrm/xfrm_state.c

index 94ce082b29dcdba2d726cbc90a0c4510fd38fb2b..89d3d8ae204ec9f8e331862175b660d4377898e0 100644 (file)
@@ -1548,7 +1548,7 @@ struct xfrm_policy *xfrm_policy_byid(struct net *net, u32 mark, u8, int dir, u32
 int xfrm_policy_flush(struct net *net, u8 type, struct xfrm_audit *audit_info);
 u32 xfrm_get_acqseq(void);
 extern int xfrm_alloc_spi(struct xfrm_state *x, u32 minspi, u32 maxspi);
-struct xfrm_state *xfrm_find_acq(struct net *net, struct xfrm_mark *mark,
+struct xfrm_state *xfrm_find_acq(struct net *net, const struct xfrm_mark *mark,
                                 u8 mode, u32 reqid, u8 proto,
                                 const xfrm_address_t *daddr,
                                 const xfrm_address_t *saddr, int create,
index ab8bd2cabfa090a4fa50524e7a76064891e535d6..4089a210e8527c181d28c6e07eeb9e5d85dd5adf 100644 (file)
@@ -45,7 +45,7 @@ struct netns_pfkey {
 static DEFINE_MUTEX(pfkey_mutex);
 
 #define DUMMY_MARK 0
-static struct xfrm_mark dummy_mark = {0, 0};
+static const struct xfrm_mark dummy_mark = {0, 0};
 struct pfkey_sock {
        /* struct sock must be the first member of struct pfkey_sock */
        struct sock     sk;
index 78f66fa92449c92865dfa8314020854ed704744f..b2cd806c0be344e0f94b55a64cdc172ae605b87c 100644 (file)
@@ -990,11 +990,13 @@ void xfrm_state_insert(struct xfrm_state *x)
 EXPORT_SYMBOL(xfrm_state_insert);
 
 /* xfrm_state_lock is held */
-static struct xfrm_state *__find_acq_core(struct net *net, struct xfrm_mark *m,
+static struct xfrm_state *__find_acq_core(struct net *net,
+                                         const struct xfrm_mark *m,
                                          unsigned short family, u8 mode,
                                          u32 reqid, u8 proto,
                                          const xfrm_address_t *daddr,
-                                         const xfrm_address_t *saddr, int create)
+                                         const xfrm_address_t *saddr,
+                                         int create)
 {
        unsigned int h = xfrm_dst_hash(net, daddr, saddr, reqid, family);
        struct xfrm_state *x;
@@ -1399,9 +1401,9 @@ xfrm_state_lookup_byaddr(struct net *net, u32 mark,
 EXPORT_SYMBOL(xfrm_state_lookup_byaddr);
 
 struct xfrm_state *
-xfrm_find_acq(struct net *net, struct xfrm_mark *mark, u8 mode, u32 reqid, u8 proto,
-             const xfrm_address_t *daddr, const xfrm_address_t *saddr,
-             int create, unsigned short family)
+xfrm_find_acq(struct net *net, const struct xfrm_mark *mark, u8 mode, u32 reqid,
+             u8 proto, const xfrm_address_t *daddr,
+             const xfrm_address_t *saddr, int create, unsigned short family)
 {
        struct xfrm_state *x;
 
This page took 0.031627 seconds and 5 git commands to generate.