Skip to content

Commit 43024b9

Browse files
Yossef Efraimklassert
authored andcommitted
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 <[email protected]> Signed-off-by: Steffen Klassert <[email protected]>
1 parent 0ba23a2 commit 43024b9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/xfrm/xfrm_device.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ int xfrm_dev_state_add(struct net *net, struct xfrm_state *x,
6767

6868
/* We don't yet support UDP encapsulation, TFC padding and ESN. */
6969
if (x->encap || x->tfcpad || (x->props.flags & XFRM_STATE_ESN))
70-
return 0;
70+
return -EINVAL;
7171

7272
dev = dev_get_by_index(net, xuo->ifindex);
7373
if (!dev) {

0 commit comments

Comments
 (0)