Skip to content
Commit e03c3bba authored by Yan Yan's avatar Yan Yan Committed by Steffen Klassert
Browse files

xfrm: Fix xfrm migrate issues when address family changes

xfrm_migrate cannot handle address family change of an xfrm_state.
The symptons are the xfrm_state will be migrated to a wrong address,
and sending as well as receiving packets wil be broken.

This commit fixes it by breaking the original xfrm_state_clone
method into two steps so as to update the props.family before
running xfrm_init_state. As the result, xfrm_state's inner mode,
outer mode, type and IP header length in xfrm_state_migrate can
be updated with the new address family.

Tested with additions to Android's kernel unit test suite:
https://android-review.googlesource.com/c/kernel/tests/+/1885354



Signed-off-by: default avatarYan Yan <evitayan@google.com>
Signed-off-by: default avatarSteffen Klassert <steffen.klassert@secunet.com>
parent c1aca308
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