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

[XFRM]: misc annotations

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d2ecd9cc
...@@ -951,9 +951,9 @@ extern int xfrm6_input_addr(struct sk_buff *skb, xfrm_address_t *daddr, ...@@ -951,9 +951,9 @@ extern int xfrm6_input_addr(struct sk_buff *skb, xfrm_address_t *daddr,
xfrm_address_t *saddr, u8 proto); xfrm_address_t *saddr, u8 proto);
extern int xfrm6_tunnel_register(struct xfrm6_tunnel *handler); extern int xfrm6_tunnel_register(struct xfrm6_tunnel *handler);
extern int xfrm6_tunnel_deregister(struct xfrm6_tunnel *handler); extern int xfrm6_tunnel_deregister(struct xfrm6_tunnel *handler);
extern u32 xfrm6_tunnel_alloc_spi(xfrm_address_t *saddr); extern __be32 xfrm6_tunnel_alloc_spi(xfrm_address_t *saddr);
extern void xfrm6_tunnel_free_spi(xfrm_address_t *saddr); extern void xfrm6_tunnel_free_spi(xfrm_address_t *saddr);
extern u32 xfrm6_tunnel_spi_lookup(xfrm_address_t *saddr); extern __be32 xfrm6_tunnel_spi_lookup(xfrm_address_t *saddr);
extern int xfrm6_output(struct sk_buff *skb); extern int xfrm6_output(struct sk_buff *skb);
extern int xfrm6_find_1stfragopt(struct xfrm_state *x, struct sk_buff *skb, extern int xfrm6_find_1stfragopt(struct xfrm_state *x, struct sk_buff *skb,
u8 **prevhdr); u8 **prevhdr);
...@@ -1033,7 +1033,7 @@ static inline int xfrm_addr_cmp(xfrm_address_t *a, xfrm_address_t *b, ...@@ -1033,7 +1033,7 @@ static inline int xfrm_addr_cmp(xfrm_address_t *a, xfrm_address_t *b,
switch (family) { switch (family) {
default: default:
case AF_INET: case AF_INET:
return a->a4 - b->a4; return (__force __u32)a->a4 - (__force __u32)b->a4;
case AF_INET6: case AF_INET6:
return ipv6_addr_cmp((struct in6_addr *)a, return ipv6_addr_cmp((struct in6_addr *)a,
(struct in6_addr *)b); (struct in6_addr *)b);
......
...@@ -72,8 +72,8 @@ __xfrm4_bundle_create(struct xfrm_policy *policy, struct xfrm_state **xfrm, int ...@@ -72,8 +72,8 @@ __xfrm4_bundle_create(struct xfrm_policy *policy, struct xfrm_state **xfrm, int
struct dst_entry *dst, *dst_prev; struct dst_entry *dst, *dst_prev;
struct rtable *rt0 = (struct rtable*)(*dst_p); struct rtable *rt0 = (struct rtable*)(*dst_p);
struct rtable *rt = rt0; struct rtable *rt = rt0;
u32 remote = fl->fl4_dst; __be32 remote = fl->fl4_dst;
u32 local = fl->fl4_src; __be32 local = fl->fl4_src;
struct flowi fl_tunnel = { struct flowi fl_tunnel = {
.nl_u = { .nl_u = {
.ip4_u = { .ip4_u = {
...@@ -203,7 +203,7 @@ _decode_session4(struct sk_buff *skb, struct flowi *fl) ...@@ -203,7 +203,7 @@ _decode_session4(struct sk_buff *skb, struct flowi *fl)
case IPPROTO_SCTP: case IPPROTO_SCTP:
case IPPROTO_DCCP: case IPPROTO_DCCP:
if (pskb_may_pull(skb, xprth + 4 - skb->data)) { if (pskb_may_pull(skb, xprth + 4 - skb->data)) {
u16 *ports = (u16 *)xprth; __be16 *ports = (__be16 *)xprth;
fl->fl_ip_sport = ports[0]; fl->fl_ip_sport = ports[0];
fl->fl_ip_dport = ports[1]; fl->fl_ip_dport = ports[1];
......
...@@ -278,7 +278,7 @@ _decode_session6(struct sk_buff *skb, struct flowi *fl) ...@@ -278,7 +278,7 @@ _decode_session6(struct sk_buff *skb, struct flowi *fl)
case IPPROTO_SCTP: case IPPROTO_SCTP:
case IPPROTO_DCCP: case IPPROTO_DCCP:
if (pskb_may_pull(skb, skb->nh.raw + offset + 4 - skb->data)) { if (pskb_may_pull(skb, skb->nh.raw + offset + 4 - skb->data)) {
u16 *ports = (u16 *)exthdr; __be16 *ports = (__be16 *)exthdr;
fl->fl_ip_sport = ports[0]; fl->fl_ip_sport = ports[0];
fl->fl_ip_dport = ports[1]; fl->fl_ip_dport = ports[1];
......
...@@ -62,7 +62,7 @@ static unsigned inline xfrm6_tunnel_spi_hash_byaddr(xfrm_address_t *addr) ...@@ -62,7 +62,7 @@ static unsigned inline xfrm6_tunnel_spi_hash_byaddr(xfrm_address_t *addr)
{ {
unsigned h; unsigned h;
h = addr->a6[0] ^ addr->a6[1] ^ addr->a6[2] ^ addr->a6[3]; h = (__force u32)(addr->a6[0] ^ addr->a6[1] ^ addr->a6[2] ^ addr->a6[3]);
h ^= h >> 16; h ^= h >> 16;
h ^= h >> 8; h ^= h >> 8;
h &= XFRM6_TUNNEL_SPI_BYADDR_HSIZE - 1; h &= XFRM6_TUNNEL_SPI_BYADDR_HSIZE - 1;
...@@ -126,7 +126,7 @@ static struct xfrm6_tunnel_spi *__xfrm6_tunnel_spi_lookup(xfrm_address_t *saddr) ...@@ -126,7 +126,7 @@ static struct xfrm6_tunnel_spi *__xfrm6_tunnel_spi_lookup(xfrm_address_t *saddr)
return NULL; return NULL;
} }
u32 xfrm6_tunnel_spi_lookup(xfrm_address_t *saddr) __be32 xfrm6_tunnel_spi_lookup(xfrm_address_t *saddr)
{ {
struct xfrm6_tunnel_spi *x6spi; struct xfrm6_tunnel_spi *x6spi;
u32 spi; u32 spi;
...@@ -196,7 +196,7 @@ out: ...@@ -196,7 +196,7 @@ out:
return spi; return spi;
} }
u32 xfrm6_tunnel_alloc_spi(xfrm_address_t *saddr) __be32 xfrm6_tunnel_alloc_spi(xfrm_address_t *saddr)
{ {
struct xfrm6_tunnel_spi *x6spi; struct xfrm6_tunnel_spi *x6spi;
u32 spi; u32 spi;
......
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