Commit 3a8a4221 authored by Steven King's avatar Steven King Committed by David S. Miller

[IPSEC]: Fix buglet in AF_KEY spddelete

When trying to spddelete individual entries using setkey, spddelete always 
fails.  The culprit is in net/af_key.c; spdadd sets the family field of the 
selector when creating an entry, but spddelete doesn't when building a 
selector to match for xfrm_policy_bysel.  Trivial fix is to have spddelete 
set the family field in the selector in same way spdadd does.
parent e1eaf949
......@@ -1976,7 +1976,7 @@ static int pfkey_spddelete(struct sock *sk, struct sk_buff *skb, struct sadb_msg
memset(&sel, 0, sizeof(sel));
sa = ext_hdrs[SADB_EXT_ADDRESS_SRC-1],
pfkey_sadb_addr2xfrm_addr(sa, &sel.saddr);
sel.family = pfkey_sadb_addr2xfrm_addr(sa, &sel.saddr);
sel.prefixlen_s = sa->sadb_address_prefixlen;
sel.proto = pfkey_proto_to_xfrm(sa->sadb_address_proto);
sel.sport = ((struct sockaddr_in *)(sa+1))->sin_port;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment