Commit a94cfd19 authored by Al Viro's avatar Al Viro Committed by David S. Miller

[XFRM]: xfrm_state_lookup() annotations

spi argument of xfrm_state_lookup() is net-endian
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 26977b4e
...@@ -912,7 +912,7 @@ extern int xfrm_state_check_expire(struct xfrm_state *x); ...@@ -912,7 +912,7 @@ extern int xfrm_state_check_expire(struct xfrm_state *x);
extern void xfrm_state_insert(struct xfrm_state *x); extern void xfrm_state_insert(struct xfrm_state *x);
extern int xfrm_state_add(struct xfrm_state *x); extern int xfrm_state_add(struct xfrm_state *x);
extern int xfrm_state_update(struct xfrm_state *x); extern int xfrm_state_update(struct xfrm_state *x);
extern struct xfrm_state *xfrm_state_lookup(xfrm_address_t *daddr, u32 spi, u8 proto, unsigned short family); extern struct xfrm_state *xfrm_state_lookup(xfrm_address_t *daddr, __be32 spi, u8 proto, unsigned short family);
extern struct xfrm_state *xfrm_state_lookup_byaddr(xfrm_address_t *daddr, xfrm_address_t *saddr, u8 proto, unsigned short family); extern struct xfrm_state *xfrm_state_lookup_byaddr(xfrm_address_t *daddr, xfrm_address_t *saddr, u8 proto, unsigned short family);
#ifdef CONFIG_XFRM_SUB_POLICY #ifdef CONFIG_XFRM_SUB_POLICY
extern int xfrm_tmpl_sort(struct xfrm_tmpl **dst, struct xfrm_tmpl **src, extern int xfrm_tmpl_sort(struct xfrm_tmpl **dst, struct xfrm_tmpl **src,
......
...@@ -183,7 +183,7 @@ out_ok: ...@@ -183,7 +183,7 @@ out_ok:
static void ipcomp4_err(struct sk_buff *skb, u32 info) static void ipcomp4_err(struct sk_buff *skb, u32 info)
{ {
u32 spi; __be32 spi;
struct iphdr *iph = (struct iphdr *)skb->data; struct iphdr *iph = (struct iphdr *)skb->data;
struct ip_comp_hdr *ipch = (struct ip_comp_hdr *)(skb->data+(iph->ihl<<2)); struct ip_comp_hdr *ipch = (struct ip_comp_hdr *)(skb->data+(iph->ihl<<2));
struct xfrm_state *x; struct xfrm_state *x;
......
...@@ -178,7 +178,7 @@ out_ok: ...@@ -178,7 +178,7 @@ out_ok:
static void ipcomp6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, static void ipcomp6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
int type, int code, int offset, __u32 info) int type, int code, int offset, __u32 info)
{ {
u32 spi; __be32 spi;
struct ipv6hdr *iph = (struct ipv6hdr*)skb->data; struct ipv6hdr *iph = (struct ipv6hdr*)skb->data;
struct ipv6_comp_hdr *ipcomph = (struct ipv6_comp_hdr*)(skb->data+offset); struct ipv6_comp_hdr *ipcomph = (struct ipv6_comp_hdr*)(skb->data+offset);
struct xfrm_state *x; struct xfrm_state *x;
...@@ -234,7 +234,7 @@ static int ipcomp6_tunnel_attach(struct xfrm_state *x) ...@@ -234,7 +234,7 @@ static int ipcomp6_tunnel_attach(struct xfrm_state *x)
{ {
int err = 0; int err = 0;
struct xfrm_state *t = NULL; struct xfrm_state *t = NULL;
u32 spi; __be32 spi;
spi = xfrm6_tunnel_spi_lookup((xfrm_address_t *)&x->props.saddr); spi = xfrm6_tunnel_spi_lookup((xfrm_address_t *)&x->props.saddr);
if (spi) if (spi)
......
...@@ -421,7 +421,7 @@ xfrm_init_tempsel(struct xfrm_state *x, struct flowi *fl, ...@@ -421,7 +421,7 @@ xfrm_init_tempsel(struct xfrm_state *x, struct flowi *fl,
return 0; return 0;
} }
static struct xfrm_state *__xfrm_state_lookup(xfrm_address_t *daddr, u32 spi, u8 proto, unsigned short family) static struct xfrm_state *__xfrm_state_lookup(xfrm_address_t *daddr, __be32 spi, u8 proto, unsigned short family)
{ {
unsigned int h = xfrm_spi_hash(daddr, spi, proto, family); unsigned int h = xfrm_spi_hash(daddr, spi, proto, family);
struct xfrm_state *x; struct xfrm_state *x;
...@@ -916,7 +916,7 @@ err: ...@@ -916,7 +916,7 @@ err:
EXPORT_SYMBOL(xfrm_state_check); EXPORT_SYMBOL(xfrm_state_check);
struct xfrm_state * struct xfrm_state *
xfrm_state_lookup(xfrm_address_t *daddr, u32 spi, u8 proto, xfrm_state_lookup(xfrm_address_t *daddr, __be32 spi, u8 proto,
unsigned short family) unsigned short family)
{ {
struct xfrm_state *x; struct xfrm_state *x;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment