Commit 987793dc authored by Brian Buesker's avatar Brian Buesker Committed by David S. Miller

[IPSEC]: Add SPD priority for PF_KEY interface.

parent 297c5dee
...@@ -181,7 +181,7 @@ struct sadb_x_policy { ...@@ -181,7 +181,7 @@ struct sadb_x_policy {
uint8_t sadb_x_policy_dir; uint8_t sadb_x_policy_dir;
uint8_t sadb_x_policy_reserved; uint8_t sadb_x_policy_reserved;
uint32_t sadb_x_policy_id; uint32_t sadb_x_policy_id;
uint32_t sadb_x_policy_reserved2; uint32_t sadb_x_policy_priority;
} __attribute__((packed)); } __attribute__((packed));
/* sizeof(struct sadb_x_policy) == 16 */ /* sizeof(struct sadb_x_policy) == 16 */
......
...@@ -1780,6 +1780,7 @@ static void pfkey_xfrm_policy2msg(struct sk_buff *skb, struct xfrm_policy *xp, i ...@@ -1780,6 +1780,7 @@ static void pfkey_xfrm_policy2msg(struct sk_buff *skb, struct xfrm_policy *xp, i
} }
pol->sadb_x_policy_dir = dir+1; pol->sadb_x_policy_dir = dir+1;
pol->sadb_x_policy_id = xp->index; pol->sadb_x_policy_id = xp->index;
pol->sadb_x_policy_priority = xp->priority;
for (i=0; i<xp->xfrm_nr; i++) { for (i=0; i<xp->xfrm_nr; i++) {
struct sadb_x_ipsecrequest *rq; struct sadb_x_ipsecrequest *rq;
...@@ -1872,6 +1873,7 @@ static int pfkey_spdadd(struct sock *sk, struct sk_buff *skb, struct sadb_msg *h ...@@ -1872,6 +1873,7 @@ static int pfkey_spdadd(struct sock *sk, struct sk_buff *skb, struct sadb_msg *h
xp->action = (pol->sadb_x_policy_type == IPSEC_POLICY_DISCARD ? xp->action = (pol->sadb_x_policy_type == IPSEC_POLICY_DISCARD ?
XFRM_POLICY_BLOCK : XFRM_POLICY_ALLOW); XFRM_POLICY_BLOCK : XFRM_POLICY_ALLOW);
xp->priority = pol->sadb_x_policy_priority;
sa = ext_hdrs[SADB_EXT_ADDRESS_SRC-1], sa = ext_hdrs[SADB_EXT_ADDRESS_SRC-1],
xp->family = pfkey_sadb_addr2xfrm_addr(sa, &xp->selector.saddr); xp->family = pfkey_sadb_addr2xfrm_addr(sa, &xp->selector.saddr);
......
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