If kernel doesn't support external ack, log that to aide
in any problem diagnosis.

Coverity issue: 362848
Fixes: 647909bcf34b ("net/tap: use netlink extended ack support")
Signed-off-by: Stephen Hemminger <step...@networkplumber.org>
---
 drivers/net/tap/tap_netlink.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/tap/tap_netlink.c b/drivers/net/tap/tap_netlink.c
index 75af3404b035..d9c260127d52 100644
--- a/drivers/net/tap/tap_netlink.c
+++ b/drivers/net/tap/tap_netlink.c
@@ -72,7 +72,8 @@ tap_nl_init(uint32_t nl_groups)
 
 #ifdef NETLINK_EXT_ACK
        /* Ask for extended ACK response. on older kernel will ignore request. 
*/
-       setsockopt(fd, SOL_NETLINK, NETLINK_EXT_ACK, &one, sizeof(one));
+       if (setsockopt(fd, SOL_NETLINK, NETLINK_EXT_ACK, &one, sizeof(one)) < 0)
+               TAP_LOG(NOTICE, "Unable to request netlink error information");
 #endif
 
        if (bind(fd, (struct sockaddr *)&local, sizeof(local)) < 0) {
-- 
2.43.0

Reply via email to