@@ -1175,7 +1175,7 @@ static struct xfrm_policy *xfrm_policy_lookup_bytype(struct net *net, u8 type,
1175
1175
}
1176
1176
1177
1177
static struct xfrm_policy *
1178
- __xfrm_policy_lookup (struct net * net , const struct flowi * fl , u16 family , u8 dir )
1178
+ xfrm_policy_lookup (struct net * net , const struct flowi * fl , u16 family , u8 dir )
1179
1179
{
1180
1180
#ifdef CONFIG_XFRM_SUB_POLICY
1181
1181
struct xfrm_policy * pol ;
@@ -1187,26 +1187,6 @@ __xfrm_policy_lookup(struct net *net, const struct flowi *fl, u16 family, u8 dir
1187
1187
return xfrm_policy_lookup_bytype (net , XFRM_POLICY_TYPE_MAIN , fl , family , dir );
1188
1188
}
1189
1189
1190
- static struct flow_cache_object *
1191
- xfrm_policy_lookup (struct net * net , const struct flowi * fl , u16 family ,
1192
- u8 dir , struct flow_cache_object * old_obj , void * ctx )
1193
- {
1194
- struct xfrm_policy * pol ;
1195
-
1196
- if (old_obj )
1197
- xfrm_pol_put (container_of (old_obj , struct xfrm_policy , flo ));
1198
-
1199
- pol = __xfrm_policy_lookup (net , fl , family , dir );
1200
- if (IS_ERR_OR_NULL (pol ))
1201
- return ERR_CAST (pol );
1202
-
1203
- /* Resolver returns two references:
1204
- * one for cache and one for caller of flow_cache_lookup() */
1205
- xfrm_pol_hold (pol );
1206
-
1207
- return & pol -> flo ;
1208
- }
1209
-
1210
1190
static struct xfrm_policy * xfrm_sk_policy_lookup (const struct sock * sk , int dir ,
1211
1191
const struct flowi * fl , u16 family )
1212
1192
{
@@ -2028,7 +2008,7 @@ xfrm_bundle_lookup(struct net *net, const struct flowi *fl, u16 family, u8 dir,
2028
2008
/* Resolve policies to use if we couldn't get them from
2029
2009
* previous cache entry */
2030
2010
num_pols = 1 ;
2031
- pols [0 ] = __xfrm_policy_lookup (net , fl , family , dir );
2011
+ pols [0 ] = xfrm_policy_lookup (net , fl , family , dir );
2032
2012
err = xfrm_expand_policies (fl , family , pols ,
2033
2013
& num_pols , & num_xfrms );
2034
2014
if (err < 0 )
@@ -2398,16 +2378,8 @@ int __xfrm_policy_check(struct sock *sk, int dir, struct sk_buff *skb,
2398
2378
}
2399
2379
}
2400
2380
2401
- if (!pol ) {
2402
- struct flow_cache_object * flo ;
2403
-
2404
- flo = xfrm_policy_lookup (net , & fl , family , dir , NULL , NULL );
2405
-
2406
- if (IS_ERR_OR_NULL (flo ))
2407
- pol = ERR_CAST (flo );
2408
- else
2409
- pol = container_of (flo , struct xfrm_policy , flo );
2410
- }
2381
+ if (!pol )
2382
+ pol = xfrm_policy_lookup (net , & fl , family , dir );
2411
2383
2412
2384
if (IS_ERR (pol )) {
2413
2385
XFRM_INC_STATS (net , LINUX_MIB_XFRMINPOLERROR );
0 commit comments