summaryrefslogtreecommitdiffstats
path: root/net/xfrm
diff options
context:
space:
mode:
authorYossef Efraim <yossefe@mellanox.com>2017-11-28 11:49:29 +0200
committerSteffen Klassert <steffen.klassert@secunet.com>2017-12-01 07:10:01 +0100
commit43024b9ccd524ea1ad3e441edf08cb893bcd6d62 (patch)
tree662ba44c3cd217fb210b8fde7e2f03bae32fc6ac /net/xfrm
parent0ba23a211360af7b6658e4fcfc571970bbbacc55 (diff)
downloadop-kernel-dev-43024b9ccd524ea1ad3e441edf08cb893bcd6d62.zip
op-kernel-dev-43024b9ccd524ea1ad3e441edf08cb893bcd6d62.tar.gz
xfrm: Fix xfrm_dev_state_add to fail for unsupported HW SA option
xfrm_dev_state_add function returns success for unsupported HW SA options. Resulting the calling function to create SW SA without corrlating HW SA. Desipte IPSec device offloading option was chosen. These not supported HW SA options are hard coded within xfrm_dev_state_add function. SW backward compatibility will break if we add any of these option as old HW will fail with new SW. This patch changes the behaviour to return -EINVAL in case unsupported option is chosen. Notifying user application regarding failure and not breaking backward compatibility for newly added HW SA options. Signed-off-by: Yossef Efraim <yossefe@mellanox.com> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Diffstat (limited to 'net/xfrm')
-rw-r--r--net/xfrm/xfrm_device.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/xfrm/xfrm_device.c b/net/xfrm/xfrm_device.c
index 30e5746..dc68d9c 100644
--- a/net/xfrm/xfrm_device.c
+++ b/net/xfrm/xfrm_device.c
@@ -67,7 +67,7 @@ int xfrm_dev_state_add(struct net *net, struct xfrm_state *x,
/* We don't yet support UDP encapsulation, TFC padding and ESN. */
if (x->encap || x->tfcpad || (x->props.flags & XFRM_STATE_ESN))
- return 0;
+ return -EINVAL;
dev = dev_get_by_index(net, xuo->ifindex);
if (!dev) {
OpenPOWER on IntegriCloud