summaryrefslogtreecommitdiffstats
path: root/net/xfrm/xfrm_device.c
diff options
context:
space:
mode:
authorLeon Romanovsky <leonro@nvidia.com>2023-01-24 12:54:57 +0100
committerJakub Kicinski <kuba@kernel.org>2023-01-27 01:28:48 +0100
commit3089386db0901ac6ac3d99fbd601212c98217e60 (patch)
treeabd148a8bb944b34d41692b2e89450b61769457b /net/xfrm/xfrm_device.c
parentnet: ethtool: provide shims for stats aggregation helpers when CONFIG_ETHTOOL... (diff)
downloadlinux-3089386db0901ac6ac3d99fbd601212c98217e60.tar.xz
linux-3089386db0901ac6ac3d99fbd601212c98217e60.zip
xfrm: extend add policy callback to set failure reason
Almost all validation logic is in the drivers, but they are missing reliable way to convey failure reason to userspace applications. Let's use extack to return this information to users. Signed-off-by: Leon Romanovsky <leonro@nvidia.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/xfrm/xfrm_device.c')
-rw-r--r--net/xfrm/xfrm_device.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/net/xfrm/xfrm_device.c b/net/xfrm/xfrm_device.c
index 4aff76c6f12e..2cec637a4a9c 100644
--- a/net/xfrm/xfrm_device.c
+++ b/net/xfrm/xfrm_device.c
@@ -383,14 +383,13 @@ int xfrm_dev_policy_add(struct net *net, struct xfrm_policy *xp,
return -EINVAL;
}
- err = dev->xfrmdev_ops->xdo_dev_policy_add(xp);
+ err = dev->xfrmdev_ops->xdo_dev_policy_add(xp, extack);
if (err) {
xdo->dev = NULL;
xdo->real_dev = NULL;
xdo->type = XFRM_DEV_OFFLOAD_UNSPECIFIED;
xdo->dir = 0;
netdev_put(dev, &xdo->dev_tracker);
- NL_SET_ERR_MSG(extack, "Device failed to offload this policy");
return err;
}