[IPSEC] af_key: Fix thinko in pfkey_xfrm_policy2msg()
authorDavid S. Miller <davem@sunset.davemloft.net>
Wed, 18 Apr 2007 04:48:10 +0000 (21:48 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Wed, 18 Apr 2007 21:16:07 +0000 (14:16 -0700)
Make sure to actually assign the determined mode to
rq->sadb_x_ipsecrequest_mode.

Noticed by Joe Perches.

Signed-off-by: David S. Miller <davem@davemloft.net>
net/key/af_key.c

index cf77930ee51637c145afad1853e7bc97fbad7ee0..345019345f09254292831cb75c6824d826592b09 100644 (file)
@@ -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;
                if ((mode = pfkey_mode_from_xfrm(t->mode)) < 0)
                        return -EINVAL;
-               mode = pfkey_mode_from_xfrm(t->mode);
+               rq->sadb_x_ipsecrequest_mode = mode;
                rq->sadb_x_ipsecrequest_level = IPSEC_LEVEL_REQUIRE;
                if (t->reqid)
                        rq->sadb_x_ipsecrequest_level = IPSEC_LEVEL_UNIQUE;