diff options
-rw-r--r-- | include/linux/xfrm.h | 1 | ||||
-rw-r--r-- | net/xfrm/xfrm_user.c | 3 |
2 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h index 2ca6bae88721..fb0c215a3051 100644 --- a/include/linux/xfrm.h +++ b/include/linux/xfrm.h | |||
@@ -339,6 +339,7 @@ struct xfrm_usersa_info { | |||
339 | #define XFRM_STATE_NOPMTUDISC 4 | 339 | #define XFRM_STATE_NOPMTUDISC 4 |
340 | #define XFRM_STATE_WILDRECV 8 | 340 | #define XFRM_STATE_WILDRECV 8 |
341 | #define XFRM_STATE_ICMP 16 | 341 | #define XFRM_STATE_ICMP 16 |
342 | #define XFRM_STATE_AF_UNSPEC 32 | ||
342 | }; | 343 | }; |
343 | 344 | ||
344 | struct xfrm_usersa_id { | 345 | struct xfrm_usersa_id { |
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c index b976d9ed10e4..04c41504f84c 100644 --- a/net/xfrm/xfrm_user.c +++ b/net/xfrm/xfrm_user.c | |||
@@ -277,9 +277,8 @@ static void copy_from_user_state(struct xfrm_state *x, struct xfrm_usersa_info * | |||
277 | memcpy(&x->props.saddr, &p->saddr, sizeof(x->props.saddr)); | 277 | memcpy(&x->props.saddr, &p->saddr, sizeof(x->props.saddr)); |
278 | x->props.flags = p->flags; | 278 | x->props.flags = p->flags; |
279 | 279 | ||
280 | if (!x->sel.family) | 280 | if (!x->sel.family && !(p->flags & XFRM_STATE_AF_UNSPEC)) |
281 | x->sel.family = p->family; | 281 | x->sel.family = p->family; |
282 | |||
283 | } | 282 | } |
284 | 283 | ||
285 | /* | 284 | /* |