From: Ilan Tayari <il...@mellanox.com>

If the kernel responds with an error to NEWSA or DELSA,
current code disregards this.
Detect failures and return a proper value to the caller.

This is required for nic-offload-fallback to work.

Signed-off-by: Ilan Tayari <il...@mellanox.com>
---
 programs/pluto/kernel_netlink.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/programs/pluto/kernel_netlink.c b/programs/pluto/kernel_netlink.c
index a74d132df..2e26a899f 100644
--- a/programs/pluto/kernel_netlink.c
+++ b/programs/pluto/kernel_netlink.c
@@ -471,7 +471,7 @@ static bool send_netlink_msg(struct nlmsghdr *hdr,
        }
        netlink_errno = -rsp.u.e.error;
        if (rsp.n.nlmsg_type != expected_resp_type && rsp.n.nlmsg_type == 
NLMSG_ERROR) {
-               if (rsp.u.e.error != 0 && expected_resp_type != NLMSG_NOOP) {
+               if (rsp.u.e.error != 0) {
                        loglog(RC_LOG_SERIOUS,
                                "ERROR: netlink response for %s %s included 
errno %d: %s",
                                description, text_said, -rsp.u.e.error,
-- 
2.11.0

_______________________________________________
Swan-dev mailing list
Swan-dev@lists.libreswan.org
https://lists.libreswan.org/mailman/listinfo/swan-dev

Reply via email to