]> git.baikalelectronics.ru Git - kernel.git/commit
xfrm: check for xdo_dev_ops add and delete
authorShannon Nelson <shannon.nelson@oracle.com>
Tue, 19 Dec 2017 23:35:48 +0000 (15:35 -0800)
committerSteffen Klassert <steffen.klassert@secunet.com>
Thu, 21 Dec 2017 07:17:48 +0000 (08:17 +0100)
commit74f40718f6389566c30405e80c7e8abcbb8f5b12
tree37fb92970c16f9294793d156a9806bed015409e1
parentb6ceb0cfff732af47b454f9fbe44b7c9db7c7ebb
xfrm: check for xdo_dev_ops add and delete

This adds a check for the required add and delete functions up front
at registration time to be sure both are defined.

Since both the features check and the registration check are looking
at the same things, break out the check for both to call.

Lastly, for some reason the feature check was setting xfrmdev_ops to
NULL if the NETIF_F_HW_ESP bit was missing, which would probably
surprise the driver later if the driver turned its NETIF_F_HW_ESP bit
back on.  We shouldn't be messing with the driver's callback list, so
we stop doing that with this patch.

Signed-off-by: Shannon Nelson <shannon.nelson@oracle.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
net/xfrm/xfrm_device.c