Skip to content

Commit

Permalink
[XFRM]: xrfm_replay_check() annotations
Browse files Browse the repository at this point in the history
seq argument is net-endian

Signed-off-by: Al Viro <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Al Viro authored and David S. Miller committed Sep 29, 2006
1 parent 6067b2b commit a252cc2
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions include/net/xfrm.h
Original file line number Diff line number Diff line change
Expand Up @@ -935,7 +935,7 @@ static inline int xfrm_state_sort(struct xfrm_state **dst, struct xfrm_state **s
extern struct xfrm_state *xfrm_find_acq_byseq(u32 seq);
extern int xfrm_state_delete(struct xfrm_state *x);
extern void xfrm_state_flush(u8 proto);
extern int xfrm_replay_check(struct xfrm_state *x, u32 seq);
extern int xfrm_replay_check(struct xfrm_state *x, __be32 seq);
extern void xfrm_replay_advance(struct xfrm_state *x, u32 seq);
extern void xfrm_replay_notify(struct xfrm_state *x, int event);
extern int xfrm_state_check(struct xfrm_state *x, struct sk_buff *skb);
Expand All @@ -945,7 +945,7 @@ extern int xfrm4_rcv(struct sk_buff *skb);
extern int xfrm4_output(struct sk_buff *skb);
extern int xfrm4_tunnel_register(struct xfrm_tunnel *handler);
extern int xfrm4_tunnel_deregister(struct xfrm_tunnel *handler);
extern int xfrm6_rcv_spi(struct sk_buff *skb, u32 spi);
extern int xfrm6_rcv_spi(struct sk_buff *skb, __be32 spi);
extern int xfrm6_rcv(struct sk_buff **pskb);
extern int xfrm6_input_addr(struct sk_buff *skb, xfrm_address_t *daddr,
xfrm_address_t *saddr, u8 proto);
Expand Down
2 changes: 1 addition & 1 deletion net/ipv6/xfrm6_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include <net/ipv6.h>
#include <net/xfrm.h>

int xfrm6_rcv_spi(struct sk_buff *skb, u32 spi)
int xfrm6_rcv_spi(struct sk_buff *skb, __be32 spi)
{
int err;
__be32 seq;
Expand Down
2 changes: 1 addition & 1 deletion net/ipv6/xfrm6_tunnel.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ static int xfrm6_tunnel_input(struct xfrm_state *x, struct sk_buff *skb)
static int xfrm6_tunnel_rcv(struct sk_buff *skb)
{
struct ipv6hdr *iph = skb->nh.ipv6h;
u32 spi;
__be32 spi;

spi = xfrm6_tunnel_spi_lookup((xfrm_address_t *)&iph->saddr);
return xfrm6_rcv_spi(skb, spi);
Expand Down
5 changes: 2 additions & 3 deletions net/xfrm/xfrm_state.c
Original file line number Diff line number Diff line change
Expand Up @@ -1180,11 +1180,10 @@ static void xfrm_replay_timer_handler(unsigned long data)
spin_unlock(&x->lock);
}

int xfrm_replay_check(struct xfrm_state *x, u32 seq)
int xfrm_replay_check(struct xfrm_state *x, __be32 net_seq)
{
u32 diff;

seq = ntohl(seq);
u32 seq = ntohl(net_seq);

if (unlikely(seq == 0))
return -EINVAL;
Expand Down

0 comments on commit a252cc2

Please sign in to comment.