diff options
Diffstat (limited to 'net/xfrm')
-rw-r--r-- | net/xfrm/xfrm_user.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c index 6b461da0b51c..055b72fb37bc 100644 --- a/net/xfrm/xfrm_user.c +++ b/net/xfrm/xfrm_user.c | |||
@@ -858,6 +858,7 @@ static void copy_templates(struct xfrm_policy *xp, struct xfrm_user_tmpl *ut, | |||
858 | int i; | 858 | int i; |
859 | 859 | ||
860 | xp->xfrm_nr = nr; | 860 | xp->xfrm_nr = nr; |
861 | xp->family = ut->family; | ||
861 | for (i = 0; i < nr; i++, ut++) { | 862 | for (i = 0; i < nr; i++, ut++) { |
862 | struct xfrm_tmpl *t = &xp->xfrm_vec[i]; | 863 | struct xfrm_tmpl *t = &xp->xfrm_vec[i]; |
863 | 864 | ||
@@ -871,6 +872,7 @@ static void copy_templates(struct xfrm_policy *xp, struct xfrm_user_tmpl *ut, | |||
871 | t->aalgos = ut->aalgos; | 872 | t->aalgos = ut->aalgos; |
872 | t->ealgos = ut->ealgos; | 873 | t->ealgos = ut->ealgos; |
873 | t->calgos = ut->calgos; | 874 | t->calgos = ut->calgos; |
875 | t->encap_family = ut->family; | ||
874 | } | 876 | } |
875 | } | 877 | } |
876 | 878 | ||
@@ -1024,7 +1026,7 @@ static int copy_to_user_tmpl(struct xfrm_policy *xp, struct sk_buff *skb) | |||
1024 | struct xfrm_tmpl *kp = &xp->xfrm_vec[i]; | 1026 | struct xfrm_tmpl *kp = &xp->xfrm_vec[i]; |
1025 | 1027 | ||
1026 | memcpy(&up->id, &kp->id, sizeof(up->id)); | 1028 | memcpy(&up->id, &kp->id, sizeof(up->id)); |
1027 | up->family = xp->family; | 1029 | up->family = kp->encap_family; |
1028 | memcpy(&up->saddr, &kp->saddr, sizeof(up->saddr)); | 1030 | memcpy(&up->saddr, &kp->saddr, sizeof(up->saddr)); |
1029 | up->reqid = kp->reqid; | 1031 | up->reqid = kp->reqid; |
1030 | up->mode = kp->mode; | 1032 | up->mode = kp->mode; |