xfrm: Fix xfrm_dev_state_add to fail for unsupported HW SA option
authorYossef Efraim <yossefe@mellanox.com>
Tue, 28 Nov 2017 09:49:29 +0000 (11:49 +0200)
committerSteffen Klassert <steffen.klassert@secunet.com>
Fri, 1 Dec 2017 06:10:01 +0000 (07:10 +0100)
commit43024b9ccd524ea1ad3e441edf08cb893bcd6d62
tree662ba44c3cd217fb210b8fde7e2f03bae32fc6ac
parent0ba23a211360af7b6658e4fcfc571970bbbacc55
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>
net/xfrm/xfrm_device.c