diff options
Diffstat (limited to 'net/xfrm/xfrm_state.c')
-rw-r--r-- | net/xfrm/xfrm_state.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c index d575f0534868..f83a3d1da81b 100644 --- a/net/xfrm/xfrm_state.c +++ b/net/xfrm/xfrm_state.c | |||
@@ -1907,7 +1907,7 @@ int xfrm_state_mtu(struct xfrm_state *x, int mtu) | |||
1907 | return res; | 1907 | return res; |
1908 | } | 1908 | } |
1909 | 1909 | ||
1910 | int xfrm_init_state(struct xfrm_state *x) | 1910 | int __xfrm_init_state(struct xfrm_state *x, bool init_replay) |
1911 | { | 1911 | { |
1912 | struct xfrm_state_afinfo *afinfo; | 1912 | struct xfrm_state_afinfo *afinfo; |
1913 | struct xfrm_mode *inner_mode; | 1913 | struct xfrm_mode *inner_mode; |
@@ -1980,12 +1980,25 @@ int xfrm_init_state(struct xfrm_state *x) | |||
1980 | if (x->outer_mode == NULL) | 1980 | if (x->outer_mode == NULL) |
1981 | goto error; | 1981 | goto error; |
1982 | 1982 | ||
1983 | if (init_replay) { | ||
1984 | err = xfrm_init_replay(x); | ||
1985 | if (err) | ||
1986 | goto error; | ||
1987 | } | ||
1988 | |||
1983 | x->km.state = XFRM_STATE_VALID; | 1989 | x->km.state = XFRM_STATE_VALID; |
1984 | 1990 | ||
1985 | error: | 1991 | error: |
1986 | return err; | 1992 | return err; |
1987 | } | 1993 | } |
1988 | 1994 | ||
1995 | EXPORT_SYMBOL(__xfrm_init_state); | ||
1996 | |||
1997 | int xfrm_init_state(struct xfrm_state *x) | ||
1998 | { | ||
1999 | return __xfrm_init_state(x, true); | ||
2000 | } | ||
2001 | |||
1989 | EXPORT_SYMBOL(xfrm_init_state); | 2002 | EXPORT_SYMBOL(xfrm_init_state); |
1990 | 2003 | ||
1991 | int __net_init xfrm_state_init(struct net *net) | 2004 | int __net_init xfrm_state_init(struct net *net) |