diff options
Diffstat (limited to 'net/key/af_key.c')
-rw-r--r-- | net/key/af_key.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/net/key/af_key.c b/net/key/af_key.c index 98b72f2024ff..4879743b945a 100644 --- a/net/key/af_key.c +++ b/net/key/af_key.c | |||
@@ -690,6 +690,8 @@ static struct sk_buff * pfkey_xfrm_state2msg(struct xfrm_state *x, int add_keys, | |||
690 | sa->sadb_sa_flags |= SADB_SAFLAGS_NOECN; | 690 | sa->sadb_sa_flags |= SADB_SAFLAGS_NOECN; |
691 | if (x->props.flags & XFRM_STATE_DECAP_DSCP) | 691 | if (x->props.flags & XFRM_STATE_DECAP_DSCP) |
692 | sa->sadb_sa_flags |= SADB_SAFLAGS_DECAP_DSCP; | 692 | sa->sadb_sa_flags |= SADB_SAFLAGS_DECAP_DSCP; |
693 | if (x->props.flags & XFRM_STATE_NOPMTUDISC) | ||
694 | sa->sadb_sa_flags |= SADB_SAFLAGS_NOPMTUDISC; | ||
693 | 695 | ||
694 | /* hard time */ | 696 | /* hard time */ |
695 | if (hsc & 2) { | 697 | if (hsc & 2) { |
@@ -974,6 +976,8 @@ static struct xfrm_state * pfkey_msg2xfrm_state(struct sadb_msg *hdr, | |||
974 | x->props.flags |= XFRM_STATE_NOECN; | 976 | x->props.flags |= XFRM_STATE_NOECN; |
975 | if (sa->sadb_sa_flags & SADB_SAFLAGS_DECAP_DSCP) | 977 | if (sa->sadb_sa_flags & SADB_SAFLAGS_DECAP_DSCP) |
976 | x->props.flags |= XFRM_STATE_DECAP_DSCP; | 978 | x->props.flags |= XFRM_STATE_DECAP_DSCP; |
979 | if (sa->sadb_sa_flags & SADB_SAFLAGS_NOPMTUDISC) | ||
980 | x->props.flags |= XFRM_STATE_NOPMTUDISC; | ||
977 | 981 | ||
978 | lifetime = (struct sadb_lifetime*) ext_hdrs[SADB_EXT_LIFETIME_HARD-1]; | 982 | lifetime = (struct sadb_lifetime*) ext_hdrs[SADB_EXT_LIFETIME_HARD-1]; |
979 | if (lifetime != NULL) { | 983 | if (lifetime != NULL) { |
@@ -1096,17 +1100,11 @@ static struct xfrm_state * pfkey_msg2xfrm_state(struct sadb_msg *hdr, | |||
1096 | } | 1100 | } |
1097 | } | 1101 | } |
1098 | 1102 | ||
1099 | x->type = xfrm_get_type(proto, x->props.family); | 1103 | err = xfrm_init_state(x); |
1100 | if (x->type == NULL) { | 1104 | if (err) |
1101 | err = -ENOPROTOOPT; | ||
1102 | goto out; | ||
1103 | } | ||
1104 | if (x->type->init_state(x, NULL)) { | ||
1105 | err = -EINVAL; | ||
1106 | goto out; | 1105 | goto out; |
1107 | } | 1106 | |
1108 | x->km.seq = hdr->sadb_msg_seq; | 1107 | x->km.seq = hdr->sadb_msg_seq; |
1109 | x->km.state = XFRM_STATE_VALID; | ||
1110 | return x; | 1108 | return x; |
1111 | 1109 | ||
1112 | out: | 1110 | out: |