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

Commit fefaa75e authored by David S. Miller's avatar David S. Miller
Browse files

[IPSEC] af_key: Fix thinko in pfkey_xfrm_policy2msg()



Make sure to actually assign the determined mode to
rq->sadb_x_ipsecrequest_mode.

Noticed by Joe Perches.

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 80d74d51
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -2072,7 +2072,7 @@ static int pfkey_xfrm_policy2msg(struct sk_buff *skb, struct xfrm_policy *xp, in
		rq->sadb_x_ipsecrequest_proto = t->id.proto;
		rq->sadb_x_ipsecrequest_proto = t->id.proto;
		if ((mode = pfkey_mode_from_xfrm(t->mode)) < 0)
		if ((mode = pfkey_mode_from_xfrm(t->mode)) < 0)
			return -EINVAL;
			return -EINVAL;
		mode = pfkey_mode_from_xfrm(t->mode);
		rq->sadb_x_ipsecrequest_mode = mode;
		rq->sadb_x_ipsecrequest_level = IPSEC_LEVEL_REQUIRE;
		rq->sadb_x_ipsecrequest_level = IPSEC_LEVEL_REQUIRE;
		if (t->reqid)
		if (t->reqid)
			rq->sadb_x_ipsecrequest_level = IPSEC_LEVEL_UNIQUE;
			rq->sadb_x_ipsecrequest_level = IPSEC_LEVEL_UNIQUE;