Skip to content

Commit

Permalink
[PF_KEY]: Fix ipsec not working in 2.6.23-rc1-git10
Browse files Browse the repository at this point in the history
Although an ipsec SA was established, kernel couldn't seem to find it.

I think since we are now using "x->sel.family" instead of "family" in
the xfrm_selector_match() called in xfrm_state_find(), af_key needs to
set this field too, just as xfrm_user.

In af_key.c, x->sel.family only gets set when there's an
ext_hdrs[SADB_EXT_ADDRESS_PROXY-1] which I think is for tunnel.

I think pfkey needs to also set the x->sel.family field when it is 0.

Tested with below patch, and ipsec worked when using pfkey.

Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Joy Latten authored and David S. Miller committed Aug 3, 2007
1 parent 3516ffb commit 4a4b627
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/key/af_key.c
Original file line number Diff line number Diff line change
Expand Up @@ -1206,6 +1206,9 @@ static struct xfrm_state * pfkey_msg2xfrm_state(struct sadb_msg *hdr,
x->sel.prefixlen_s = addr->sadb_address_prefixlen;
}

if (!x->sel.family)
x->sel.family = x->props.family;

if (ext_hdrs[SADB_X_EXT_NAT_T_TYPE-1]) {
struct sadb_x_nat_t_type* n_type;
struct xfrm_encap_tmpl *natt;
Expand Down

0 comments on commit 4a4b627

Please sign in to comment.