diff options
author | David S. Miller <davem@davemloft.net> | 2014-03-05 20:32:02 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-03-05 20:32:02 -0500 |
commit | 67ddc87f162e2d0e29db2b6b21c5a3fbcb8be206 (patch) | |
tree | c83ac73e3d569156d4b7f3dab3e7e27e0054cd0d /net/xfrm/xfrm_state.c | |
parent | 6092c79fd00ce48ee8698955ea6419cc5cd65641 (diff) | |
parent | c3bebc71c4bcdafa24b506adf0c1de3c1f77e2e0 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts:
drivers/net/wireless/ath/ath9k/recv.c
drivers/net/wireless/mwifiex/pcie.c
net/ipv6/sit.c
The SIT driver conflict consists of a bug fix being done by hand
in 'net' (missing u64_stats_init()) whilst in 'net-next' a helper
was created (netdev_alloc_pcpu_stats()) which takes care of this.
The two wireless conflicts were overlapping changes.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/xfrm/xfrm_state.c')
-rw-r--r-- | net/xfrm/xfrm_state.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c index 5339c26bb0cf..06970fee9155 100644 --- a/net/xfrm/xfrm_state.c +++ b/net/xfrm/xfrm_state.c | |||
@@ -1171,6 +1171,11 @@ static struct xfrm_state *xfrm_state_clone(struct xfrm_state *orig) | |||
1171 | } | 1171 | } |
1172 | x->props.aalgo = orig->props.aalgo; | 1172 | x->props.aalgo = orig->props.aalgo; |
1173 | 1173 | ||
1174 | if (orig->aead) { | ||
1175 | x->aead = xfrm_algo_aead_clone(orig->aead); | ||
1176 | if (!x->aead) | ||
1177 | goto error; | ||
1178 | } | ||
1174 | if (orig->ealg) { | 1179 | if (orig->ealg) { |
1175 | x->ealg = xfrm_algo_clone(orig->ealg); | 1180 | x->ealg = xfrm_algo_clone(orig->ealg); |
1176 | if (!x->ealg) | 1181 | if (!x->ealg) |
@@ -1211,6 +1216,9 @@ static struct xfrm_state *xfrm_state_clone(struct xfrm_state *orig) | |||
1211 | x->props.flags = orig->props.flags; | 1216 | x->props.flags = orig->props.flags; |
1212 | x->props.extra_flags = orig->props.extra_flags; | 1217 | x->props.extra_flags = orig->props.extra_flags; |
1213 | 1218 | ||
1219 | x->tfcpad = orig->tfcpad; | ||
1220 | x->replay_maxdiff = orig->replay_maxdiff; | ||
1221 | x->replay_maxage = orig->replay_maxage; | ||
1214 | x->curlft.add_time = orig->curlft.add_time; | 1222 | x->curlft.add_time = orig->curlft.add_time; |
1215 | x->km.state = orig->km.state; | 1223 | x->km.state = orig->km.state; |
1216 | x->km.seq = orig->km.seq; | 1224 | x->km.seq = orig->km.seq; |
@@ -1223,11 +1231,12 @@ out: | |||
1223 | return NULL; | 1231 | return NULL; |
1224 | } | 1232 | } |
1225 | 1233 | ||
1226 | /* net->xfrm.xfrm_state_lock is held */ | ||
1227 | struct xfrm_state *xfrm_migrate_state_find(struct xfrm_migrate *m, struct net *net) | 1234 | struct xfrm_state *xfrm_migrate_state_find(struct xfrm_migrate *m, struct net *net) |
1228 | { | 1235 | { |
1229 | unsigned int h; | 1236 | unsigned int h; |
1230 | struct xfrm_state *x; | 1237 | struct xfrm_state *x = NULL; |
1238 | |||
1239 | spin_lock_bh(&net->xfrm.xfrm_state_lock); | ||
1231 | 1240 | ||
1232 | if (m->reqid) { | 1241 | if (m->reqid) { |
1233 | h = xfrm_dst_hash(net, &m->old_daddr, &m->old_saddr, | 1242 | h = xfrm_dst_hash(net, &m->old_daddr, &m->old_saddr, |
@@ -1244,7 +1253,7 @@ struct xfrm_state *xfrm_migrate_state_find(struct xfrm_migrate *m, struct net *n | |||
1244 | m->old_family)) | 1253 | m->old_family)) |
1245 | continue; | 1254 | continue; |
1246 | xfrm_state_hold(x); | 1255 | xfrm_state_hold(x); |
1247 | return x; | 1256 | break; |
1248 | } | 1257 | } |
1249 | } else { | 1258 | } else { |
1250 | h = xfrm_src_hash(net, &m->old_daddr, &m->old_saddr, | 1259 | h = xfrm_src_hash(net, &m->old_daddr, &m->old_saddr, |
@@ -1259,11 +1268,13 @@ struct xfrm_state *xfrm_migrate_state_find(struct xfrm_migrate *m, struct net *n | |||
1259 | m->old_family)) | 1268 | m->old_family)) |
1260 | continue; | 1269 | continue; |
1261 | xfrm_state_hold(x); | 1270 | xfrm_state_hold(x); |
1262 | return x; | 1271 | break; |
1263 | } | 1272 | } |
1264 | } | 1273 | } |
1265 | 1274 | ||
1266 | return NULL; | 1275 | spin_unlock_bh(&net->xfrm.xfrm_state_lock); |
1276 | |||
1277 | return x; | ||
1267 | } | 1278 | } |
1268 | EXPORT_SYMBOL(xfrm_migrate_state_find); | 1279 | EXPORT_SYMBOL(xfrm_migrate_state_find); |
1269 | 1280 | ||
@@ -1458,7 +1469,7 @@ xfrm_state_sort(struct xfrm_state **dst, struct xfrm_state **src, int n, | |||
1458 | { | 1469 | { |
1459 | int err = 0; | 1470 | int err = 0; |
1460 | struct xfrm_state_afinfo *afinfo = xfrm_state_get_afinfo(family); | 1471 | struct xfrm_state_afinfo *afinfo = xfrm_state_get_afinfo(family); |
1461 | struct net *net = xs_net(*dst); | 1472 | struct net *net = xs_net(*src); |
1462 | 1473 | ||
1463 | if (!afinfo) | 1474 | if (!afinfo) |
1464 | return -EAFNOSUPPORT; | 1475 | return -EAFNOSUPPORT; |