Commit 97ddbec4 authored by Herbert Xu's avatar Herbert Xu Committed by Stephen Hemminger

[XFRM_USER]: Add inner family field to all SAs and templates.

parent 5dbaaa44
...@@ -37,6 +37,7 @@ struct xfrm_selector ...@@ -37,6 +37,7 @@ struct xfrm_selector
__u16 dport_mask; __u16 dport_mask;
__u16 sport; __u16 sport;
__u16 sport_mask; __u16 sport_mask;
__u16 family;
__u8 prefixlen_d; __u8 prefixlen_d;
__u8 prefixlen_s; __u8 prefixlen_s;
__u8 proto; __u8 proto;
...@@ -125,6 +126,7 @@ enum ...@@ -125,6 +126,7 @@ enum
struct xfrm_user_tmpl { struct xfrm_user_tmpl {
struct xfrm_id id; struct xfrm_id id;
__u16 family;
xfrm_address_t saddr; xfrm_address_t saddr;
__u32 reqid; __u32 reqid;
__u8 mode; __u8 mode;
...@@ -189,7 +191,6 @@ struct xfrm_userpolicy_info { ...@@ -189,7 +191,6 @@ struct xfrm_userpolicy_info {
struct xfrm_lifetime_cur curlft; struct xfrm_lifetime_cur curlft;
__u32 priority; __u32 priority;
__u32 index; __u32 index;
__u16 family;
__u8 dir; __u8 dir;
__u8 action; __u8 action;
#define XFRM_POLICY_ALLOW 0 #define XFRM_POLICY_ALLOW 0
......
...@@ -527,7 +527,7 @@ static int verify_newpolicy_info(struct xfrm_userpolicy_info *p) ...@@ -527,7 +527,7 @@ static int verify_newpolicy_info(struct xfrm_userpolicy_info *p)
return -EINVAL; return -EINVAL;
}; };
switch (p->family) { switch (p->sel.family) {
case AF_INET: case AF_INET:
break; break;
...@@ -594,7 +594,7 @@ static void copy_from_user_policy(struct xfrm_policy *xp, struct xfrm_userpolicy ...@@ -594,7 +594,7 @@ static void copy_from_user_policy(struct xfrm_policy *xp, struct xfrm_userpolicy
memcpy(&xp->lft, &p->lft, sizeof(xp->lft)); memcpy(&xp->lft, &p->lft, sizeof(xp->lft));
xp->action = p->action; xp->action = p->action;
xp->flags = p->flags; xp->flags = p->flags;
xp->family = p->family; xp->family = p->sel.family;
/* XXX xp->share = p->share; */ /* XXX xp->share = p->share; */
} }
...@@ -605,7 +605,7 @@ static void copy_to_user_policy(struct xfrm_policy *xp, struct xfrm_userpolicy_i ...@@ -605,7 +605,7 @@ static void copy_to_user_policy(struct xfrm_policy *xp, struct xfrm_userpolicy_i
memcpy(&p->curlft, &xp->curlft, sizeof(p->curlft)); memcpy(&p->curlft, &xp->curlft, sizeof(p->curlft));
p->priority = xp->priority; p->priority = xp->priority;
p->index = xp->index; p->index = xp->index;
p->family = xp->family; p->sel.family = xp->family;
p->dir = dir; p->dir = dir;
p->action = xp->action; p->action = xp->action;
p->flags = xp->flags; p->flags = xp->flags;
......
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