aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/xfrm.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-02-24 01:42:28 -0500
committerDavid S. Miller <davem@davemloft.net>2011-02-24 02:07:45 -0500
commitf8848067caff97ce03ee9beef8b6dd5c70f7e736 (patch)
tree25999d454fde90d976638f83aafc843eef7eb787 /include/net/xfrm.h
parent21eddb5c1e972727fadec57d8c340dcf814d7902 (diff)
xfrm: Const'ify ptr args to xfrm_state_*_check and xfrm_state_kern.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/xfrm.h')
-rw-r--r--include/net/xfrm.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index f6d2f635c81..3205e5e4379 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -1178,8 +1178,8 @@ void xfrm_flowi_addr_get(const struct flowi *fl,
1178} 1178}
1179 1179
1180static __inline__ int 1180static __inline__ int
1181__xfrm4_state_addr_check(struct xfrm_state *x, 1181__xfrm4_state_addr_check(const struct xfrm_state *x,
1182 xfrm_address_t *daddr, xfrm_address_t *saddr) 1182 const xfrm_address_t *daddr, const xfrm_address_t *saddr)
1183{ 1183{
1184 if (daddr->a4 == x->id.daddr.a4 && 1184 if (daddr->a4 == x->id.daddr.a4 &&
1185 (saddr->a4 == x->props.saddr.a4 || !saddr->a4 || !x->props.saddr.a4)) 1185 (saddr->a4 == x->props.saddr.a4 || !saddr->a4 || !x->props.saddr.a4))
@@ -1188,8 +1188,8 @@ __xfrm4_state_addr_check(struct xfrm_state *x,
1188} 1188}
1189 1189
1190static __inline__ int 1190static __inline__ int
1191__xfrm6_state_addr_check(struct xfrm_state *x, 1191__xfrm6_state_addr_check(const struct xfrm_state *x,
1192 xfrm_address_t *daddr, xfrm_address_t *saddr) 1192 const xfrm_address_t *daddr, const xfrm_address_t *saddr)
1193{ 1193{
1194 if (!ipv6_addr_cmp((struct in6_addr *)daddr, (struct in6_addr *)&x->id.daddr) && 1194 if (!ipv6_addr_cmp((struct in6_addr *)daddr, (struct in6_addr *)&x->id.daddr) &&
1195 (!ipv6_addr_cmp((struct in6_addr *)saddr, (struct in6_addr *)&x->props.saddr)|| 1195 (!ipv6_addr_cmp((struct in6_addr *)saddr, (struct in6_addr *)&x->props.saddr)||
@@ -1200,8 +1200,8 @@ __xfrm6_state_addr_check(struct xfrm_state *x,
1200} 1200}
1201 1201
1202static __inline__ int 1202static __inline__ int
1203xfrm_state_addr_check(struct xfrm_state *x, 1203xfrm_state_addr_check(const struct xfrm_state *x,
1204 xfrm_address_t *daddr, xfrm_address_t *saddr, 1204 const xfrm_address_t *daddr, const xfrm_address_t *saddr,
1205 unsigned short family) 1205 unsigned short family)
1206{ 1206{
1207 switch (family) { 1207 switch (family) {
@@ -1214,23 +1214,23 @@ xfrm_state_addr_check(struct xfrm_state *x,
1214} 1214}
1215 1215
1216static __inline__ int 1216static __inline__ int
1217xfrm_state_addr_flow_check(struct xfrm_state *x, const struct flowi *fl, 1217xfrm_state_addr_flow_check(const struct xfrm_state *x, const struct flowi *fl,
1218 unsigned short family) 1218 unsigned short family)
1219{ 1219{
1220 switch (family) { 1220 switch (family) {
1221 case AF_INET: 1221 case AF_INET:
1222 return __xfrm4_state_addr_check(x, 1222 return __xfrm4_state_addr_check(x,
1223 (xfrm_address_t *)&fl->fl4_dst, 1223 (const xfrm_address_t *)&fl->fl4_dst,
1224 (xfrm_address_t *)&fl->fl4_src); 1224 (const xfrm_address_t *)&fl->fl4_src);
1225 case AF_INET6: 1225 case AF_INET6:
1226 return __xfrm6_state_addr_check(x, 1226 return __xfrm6_state_addr_check(x,
1227 (xfrm_address_t *)&fl->fl6_dst, 1227 (const xfrm_address_t *)&fl->fl6_dst,
1228 (xfrm_address_t *)&fl->fl6_src); 1228 (const xfrm_address_t *)&fl->fl6_src);
1229 } 1229 }
1230 return 0; 1230 return 0;
1231} 1231}
1232 1232
1233static inline int xfrm_state_kern(struct xfrm_state *x) 1233static inline int xfrm_state_kern(const struct xfrm_state *x)
1234{ 1234{
1235 return atomic_read(&x->tunnel_users); 1235 return atomic_read(&x->tunnel_users);
1236} 1236}