[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180601081849.3929-1-ivecera@redhat.com>
Date: Fri, 1 Jun 2018 10:18:49 +0200
From: Ivan Vecera <ivecera@...hat.com>
To: netdev@...r.kernel.org
Cc: Arkadi Sharshevsky <arkadis@...lanox.com>,
Stephen Hemminger <stephen@...workplumber.org>
Subject: [PATCH iproute2] devlink: don't enforce NETLINK_{CAP,EXT}_ACK sock opts
Since commit 049c58539f5d ("devlink: mnlg: Add support for extended ack")
devlink requires NETLINK_{CAP,EXT}_ACK. This prevents devlink from
working with older kernels that don't support these features.
host # ./devlink/devlink
Failed to connect to devlink Netlink
Fixes: 049c58539f5d ("devlink: mnlg: Add support for extended ack")
Cc: Arkadi Sharshevsky <arkadis@...lanox.com>
Cc: Stephen Hemminger <stephen@...workplumber.org>
Signed-off-by: Ivan Vecera <ivecera@...hat.com>
---
devlink/mnlg.c | 14 +++-----------
1 file changed, 3 insertions(+), 11 deletions(-)
diff --git a/devlink/mnlg.c b/devlink/mnlg.c
index 3d28453a..c33c90be 100644
--- a/devlink/mnlg.c
+++ b/devlink/mnlg.c
@@ -271,15 +271,9 @@ struct mnlg_socket *mnlg_socket_open(const char *family_name, uint8_t version)
if (!nlg->nl)
goto err_mnl_socket_open;
- err = mnl_socket_setsockopt(nlg->nl, NETLINK_CAP_ACK, &one,
- sizeof(one));
- if (err)
- goto err_mnl_set_ack;
-
- err = mnl_socket_setsockopt(nlg->nl, NETLINK_EXT_ACK, &one,
- sizeof(one));
- if (err)
- goto err_mnl_set_ext_ack;
+ /* Older kernels may no support capped/extended ACK reporting */
+ mnl_socket_setsockopt(nlg->nl, NETLINK_CAP_ACK, &one, sizeof(one));
+ mnl_socket_setsockopt(nlg->nl, NETLINK_EXT_ACK, &one, sizeof(one));
err = mnl_socket_bind(nlg->nl, 0, MNL_SOCKET_AUTOPID);
if (err < 0)
@@ -305,8 +299,6 @@ struct mnlg_socket *mnlg_socket_open(const char *family_name, uint8_t version)
err_mnlg_socket_recv_run:
err_mnlg_socket_send:
err_mnl_socket_bind:
-err_mnl_set_ext_ack:
-err_mnl_set_ack:
mnl_socket_close(nlg->nl);
err_mnl_socket_open:
free(nlg->buf);
--
2.16.1
Powered by blists - more mailing lists