Skip to content

Commit

Permalink
net/tap: log Netlink extended ack unavailability
Browse files Browse the repository at this point in the history
[ upstream commit 59c1eb37478b2ee30f5821bd4fc46b3de5929121 ]

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

Coverity issue: 362848
Fixes: 647909b ("net/tap: use netlink extended ack support")

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
  • Loading branch information
shemminger authored and bluca committed Mar 13, 2024
1 parent 7019fde commit 4998942
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/net/tap/tap_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 4998942

Please sign in to comment.