[Swan-dev] [libreswan RFC 1/3] kernel_netlink: Detect netlink SA failures
ilant at mellanox.com
ilant at mellanox.com
Tue Jul 11 15:09:05 UTC 2017
From: Ilan Tayari <ilant at 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 <ilant at 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
More information about the Swan-dev
mailing list