[RAMEN9610-20741]UPSTREAM: xfrm: Return detailed errors from xfrmi_newlink
authorBenedict Wong <benedictwong@google.com>
Wed, 25 Jul 2018 20:45:29 +0000 (13:45 -0700)
committerrobot <robot@samsung.com>
Sun, 27 Oct 2019 17:53:50 +0000 (02:53 +0900)
commit8725cb9a087ddf34bb0e4b614f06135e96499626
tree4eb25f8226f6cc293a0248fe5a6a29a5ef94e0d4
parent60e4e6e60e28d43037898610978f17e36fc79d00
[RAMEN9610-20741]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