aboutsummaryrefslogtreecommitdiffstats
path: root/net/xfrm/xfrm_input.c
diff options
context:
space:
mode:
authorSteffen Klassert <steffen.klassert@secunet.com>2011-03-07 19:08:32 -0500
committerDavid S. Miller <davem@davemloft.net>2011-03-13 23:22:30 -0400
commit9fdc4883d92d20842c5acea77a4a21bb1574b495 (patch)
tree87019e64093d90a4f2b42149231d0ad3a864c5f9 /net/xfrm/xfrm_input.c
parentd212a4c29096484e5e83b5006e695add126260af (diff)
xfrm: Move IPsec replay detection functions to a separate file
To support multiple versions of replay detection, we move the replay detection functions to a separate file and make them accessible via function pointers contained in the struct xfrm_replay. Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com> Acked-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/xfrm/xfrm_input.c')
-rw-r--r--net/xfrm/xfrm_input.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/net/xfrm/xfrm_input.c b/net/xfrm/xfrm_input.c
index b173b7fdc433..55d5f5c3d119 100644
--- a/net/xfrm/xfrm_input.c
+++ b/net/xfrm/xfrm_input.c
@@ -172,7 +172,7 @@ int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type)
172 goto drop_unlock; 172 goto drop_unlock;
173 } 173 }
174 174
175 if (x->props.replay_window && xfrm_replay_check(x, skb, seq)) { 175 if (x->props.replay_window && x->repl->check(x, skb, seq)) {
176 XFRM_INC_STATS(net, LINUX_MIB_XFRMINSTATESEQERROR); 176 XFRM_INC_STATS(net, LINUX_MIB_XFRMINSTATESEQERROR);
177 goto drop_unlock; 177 goto drop_unlock;
178 } 178 }
@@ -206,8 +206,7 @@ resume:
206 /* only the first xfrm gets the encap type */ 206 /* only the first xfrm gets the encap type */
207 encap_type = 0; 207 encap_type = 0;
208 208
209 if (x->props.replay_window) 209 x->repl->advance(x, seq);
210 xfrm_replay_advance(x, seq);
211 210
212 x->curlft.bytes += skb->len; 211 x->curlft.bytes += skb->len;
213 x->curlft.packets++; 212 x->curlft.packets++;