diff options
| author | Brian Buesker <bbuesker@qualcomm.com> | 2004-04-18 21:42:50 -0700 |
|---|---|---|
| committer | David S. Miller <davem@hera.kernel.org> | 2004-04-18 21:42:50 -0700 |
| commit | 987793dcac3ab8dfa05924a5baf42d4fcbf87668 (patch) | |
| tree | 3241aa97334dca55bc267a897369d0d77ab39690 | |
| parent | 297c5dee580093e646d3b734be47e79af27a86a0 (diff) | |
[IPSEC]: Add SPD priority for PF_KEY interface.
| -rw-r--r-- | include/linux/pfkeyv2.h | 2 | ||||
| -rw-r--r-- | net/key/af_key.c | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/include/linux/pfkeyv2.h b/include/linux/pfkeyv2.h index 81807d58bb3e..a48a3ecc7c21 100644 --- a/include/linux/pfkeyv2.h +++ b/include/linux/pfkeyv2.h @@ -181,7 +181,7 @@ struct sadb_x_policy { uint8_t sadb_x_policy_dir; uint8_t sadb_x_policy_reserved; uint32_t sadb_x_policy_id; - uint32_t sadb_x_policy_reserved2; + uint32_t sadb_x_policy_priority; } __attribute__((packed)); /* sizeof(struct sadb_x_policy) == 16 */ diff --git a/net/key/af_key.c b/net/key/af_key.c index 6ce0dc19f332..6f360a610250 100644 --- a/net/key/af_key.c +++ b/net/key/af_key.c @@ -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_id = xp->index; + pol->sadb_x_policy_priority = xp->priority; for (i=0; i<xp->xfrm_nr; i++) { struct sadb_x_ipsecrequest *rq; @@ -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 ? XFRM_POLICY_BLOCK : XFRM_POLICY_ALLOW); + xp->priority = pol->sadb_x_policy_priority; sa = ext_hdrs[SADB_EXT_ADDRESS_SRC-1], xp->family = pfkey_sadb_addr2xfrm_addr(sa, &xp->selector.saddr); |
