UPSTREAM: xfrm: Return detailed errors from xfrmi_newlink
authorBenedict Wong <benedictwong@google.com>
Wed, 25 Jul 2018 20:45:29 +0000 (13:45 -0700)
committerxiest1 <xiest1@lenovo.com>
Tue, 5 Nov 2019 09:32:14 +0000 (17:32 +0800)
commit69a00f7a7a11e5829c8d1a80997a110bba1b8f43
tree1788aa41a9b16f5763be5404675ca8c3dafa8c96
parentfd44aaa9acb630c7c3cc9158794b9b6774c87626
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