]> err.no Git - linux-2.6/commitdiff
af_key: Fix selector family initialization.
authorKazunori MIYAZAWA <kazunori@miyazawa.org>
Wed, 21 May 2008 20:26:11 +0000 (13:26 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 21 May 2008 20:26:11 +0000 (13:26 -0700)
This propagates the xfrm_user fix made in commit
bcf0dda8d2408fe1c1040cdec5a98e5fcad2ac72 ("[XFRM]: xfrm_user: fix
selector family initialization")

Based upon a bug report from, and tested by, Alan Swanson.

Signed-off-by: Kazunori MIYAZAWA <kazunori@miyazawa.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/key/af_key.c

index 9e7236ff6bcc029e6886b43c32416bcdaa51d252..9bba7ac5fee0d30a986c49ed0b43e664b056d975 100644 (file)
@@ -1251,7 +1251,7 @@ static struct xfrm_state * pfkey_msg2xfrm_state(struct sadb_msg *hdr,
                x->sel.prefixlen_s = addr->sadb_address_prefixlen;
        }
 
-       if (x->props.mode == XFRM_MODE_TRANSPORT)
+       if (!x->sel.family)
                x->sel.family = x->props.family;
 
        if (ext_hdrs[SADB_X_EXT_NAT_T_TYPE-1]) {