UPSTREAM: xfrm: Return detailed errors from xfrmi_newlink
authorBenedict Wong <benedictwong@google.com>
Wed, 25 Jul 2018 20:45:29 +0000 (13:45 -0700)
committerlingsen1 <lingsen1@lenovo.com>
Sun, 7 Feb 2021 09:37:05 +0000 (17:37 +0800)
commit52955cf5237a1736649a0c0866d98158bd5eaffb
tree1c43cbe62c1a0447717afd86b434a0c638df0e43
parent25473db6be6ae0b12d024ae87321273f079094ff
UPSTREAM: xfrm: Return detailed errors from xfrmi_newlink

Currently all failure modes of xfrm interface creation return EEXIST.
This change improves the granularity of errnos provided by also
returning ENODEV or EINVAL if failures happen in looking up the
underlying interface, or a required parameter is not provided.

This change has been tested against the Android Kernel Networking Tests,
with additional xfrmi_newlink tests here:

https://android-review.googlesource.com/c/kernel/tests/+/715755

Signed-off-by: Benedict Wong <benedictwong@google.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
(cherry picked from commit 44e2b838c24d883dae8496dc7b6ddac7956ba53c)
Bug: 113046120
Change-Id: Ic680bf1e4a828aaae01b289223d9396a551eefd2
net/xfrm/xfrm_interface.c