Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 53059b3f authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "xfrm: Don't use sk_family for socket policy lookups"

parents 8bfb5130 c0344a7d
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -1214,7 +1214,7 @@ static inline int policy_to_flow_dir(int dir)
}

static struct xfrm_policy *xfrm_sk_policy_lookup(const struct sock *sk, int dir,
						 const struct flowi *fl)
						 const struct flowi *fl, u16 family)
{
	struct xfrm_policy *pol;
	struct net *net = sock_net(sk);
@@ -1223,8 +1223,7 @@ static struct xfrm_policy *xfrm_sk_policy_lookup(const struct sock *sk, int dir,
	read_lock_bh(&net->xfrm.xfrm_policy_lock);
	pol = rcu_dereference(sk->sk_policy[dir]);
	if (pol != NULL) {
		bool match = xfrm_selector_match(&pol->selector, fl,
						 sk->sk_family);
		bool match = xfrm_selector_match(&pol->selector, fl, family);
		int err = 0;

		if (match) {
@@ -2171,7 +2170,7 @@ struct dst_entry *xfrm_lookup(struct net *net, struct dst_entry *dst_orig,
	sk = sk_const_to_full_sk(sk);
	if (sk && sk->sk_policy[XFRM_POLICY_OUT]) {
		num_pols = 1;
		pols[0] = xfrm_sk_policy_lookup(sk, XFRM_POLICY_OUT, fl);
		pols[0] = xfrm_sk_policy_lookup(sk, XFRM_POLICY_OUT, fl, family);
		err = xfrm_expand_policies(fl, family, pols,
					   &num_pols, &num_xfrms);
		if (err < 0)
@@ -2450,7 +2449,7 @@ int __xfrm_policy_check(struct sock *sk, int dir, struct sk_buff *skb,
	pol = NULL;
	sk = sk_to_full_sk(sk);
	if (sk && sk->sk_policy[dir]) {
		pol = xfrm_sk_policy_lookup(sk, dir, &fl);
		pol = xfrm_sk_policy_lookup(sk, dir, &fl, family);
		if (IS_ERR(pol)) {
			XFRM_INC_STATS(net, LINUX_MIB_XFRMINPOLERROR);
			return 0;