Skip to content

Commit

Permalink
xfrm: Fix xfrm_dev_state_add to fail for unsupported HW SA option
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Yossef Efraim authored and Steffen Klassert committed Dec 1, 2017
1 parent 0ba23a2 commit 43024b9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/xfrm/xfrm_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 43024b9

Please sign in to comment.