@@ -1996,15 +1996,13 @@ static struct xfrm_dst *xfrm_create_dummy_bundle(struct net *net,
1996
1996
goto out ;
1997
1997
}
1998
1998
1999
- static struct flow_cache_object *
1999
+ static struct xfrm_dst *
2000
2000
xfrm_bundle_lookup (struct net * net , const struct flowi * fl , u16 family , u8 dir , struct xfrm_flo * xflo )
2001
2001
{
2002
2002
struct xfrm_policy * pols [XFRM_POLICY_TYPE_MAX ];
2003
- struct xfrm_dst * xdst , * new_xdst ;
2004
2003
int num_pols = 0 , num_xfrms = 0 , err ;
2004
+ struct xfrm_dst * xdst ;
2005
2005
2006
- /* Check if the policies from old bundle are usable */
2007
- xdst = NULL ;
2008
2006
/* Resolve policies to use if we couldn't get them from
2009
2007
* previous cache entry */
2010
2008
num_pols = 1 ;
@@ -2018,19 +2016,19 @@ xfrm_bundle_lookup(struct net *net, const struct flowi *fl, u16 family, u8 dir,
2018
2016
if (num_xfrms <= 0 )
2019
2017
goto make_dummy_bundle ;
2020
2018
2021
- new_xdst = xfrm_resolve_and_create_bundle (pols , num_pols , fl , family ,
2019
+ xdst = xfrm_resolve_and_create_bundle (pols , num_pols , fl , family ,
2022
2020
xflo -> dst_orig );
2023
- if (IS_ERR (new_xdst )) {
2024
- err = PTR_ERR (new_xdst );
2021
+ if (IS_ERR (xdst )) {
2022
+ err = PTR_ERR (xdst );
2025
2023
if (err != - EAGAIN )
2026
2024
goto error ;
2027
2025
goto make_dummy_bundle ;
2028
- } else if (new_xdst == NULL ) {
2026
+ } else if (xdst == NULL ) {
2029
2027
num_xfrms = 0 ;
2030
2028
goto make_dummy_bundle ;
2031
2029
}
2032
2030
2033
- return & new_xdst -> flo ;
2031
+ return xdst ;
2034
2032
2035
2033
make_dummy_bundle :
2036
2034
/* We found policies, but there's no bundles to instantiate:
@@ -2046,7 +2044,7 @@ xfrm_bundle_lookup(struct net *net, const struct flowi *fl, u16 family, u8 dir,
2046
2044
memcpy (xdst -> pols , pols , sizeof (struct xfrm_policy * ) * num_pols );
2047
2045
2048
2046
dst_hold (& xdst -> u .dst );
2049
- return & xdst -> flo ;
2047
+ return xdst ;
2050
2048
2051
2049
inc_error :
2052
2050
XFRM_INC_STATS (net , LINUX_MIB_XFRMOUTPOLERROR );
@@ -2082,7 +2080,6 @@ struct dst_entry *xfrm_lookup(struct net *net, struct dst_entry *dst_orig,
2082
2080
const struct sock * sk , int flags )
2083
2081
{
2084
2082
struct xfrm_policy * pols [XFRM_POLICY_TYPE_MAX ];
2085
- struct flow_cache_object * flo ;
2086
2083
struct xfrm_dst * xdst ;
2087
2084
struct dst_entry * dst , * route ;
2088
2085
u16 family = dst_orig -> ops -> family ;
@@ -2137,14 +2134,13 @@ struct dst_entry *xfrm_lookup(struct net *net, struct dst_entry *dst_orig,
2137
2134
!net -> xfrm .policy_count [XFRM_POLICY_OUT ])
2138
2135
goto nopol ;
2139
2136
2140
- flo = xfrm_bundle_lookup (net , fl , family , dir , & xflo );
2141
- if (flo == NULL )
2137
+ xdst = xfrm_bundle_lookup (net , fl , family , dir , & xflo );
2138
+ if (xdst == NULL )
2142
2139
goto nopol ;
2143
- if (IS_ERR (flo )) {
2144
- err = PTR_ERR (flo );
2140
+ if (IS_ERR (xdst )) {
2141
+ err = PTR_ERR (xdst );
2145
2142
goto dropdst ;
2146
2143
}
2147
- xdst = container_of (flo , struct xfrm_dst , flo );
2148
2144
2149
2145
num_pols = xdst -> num_pols ;
2150
2146
num_xfrms = xdst -> num_xfrms ;
0 commit comments