[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <0644F993-A061-4133-B3AD-E7BEB129EFDD@drivenets.com>
Date: Tue, 13 Jul 2021 08:09:51 +0000
From: Lahav Daniel Schlesinger <lschlesinger@...venets.com>
To: "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Patch to fix 'ip' utility recvmsg with ancillary data
A successful call to recvmsg() causes msg.msg_controllen to contain the length of the received ancillary data. However, the current code in the 'ip' utility doesn't reset this value after each recvmsg().
This means that if a call to recvmsg() doesn't have ancillary data, then msg.msg_controllen will be set to 0, causing future recvmsg() which do contain ancillary data to get MSG_CTRUNC set in msg.msg_flags.
This fixes 'ip monitor' running with the all-nsid option - With this option the kernel passes the nsid as ancillary data. If while 'ip monitor' is running an even on the current netns is received, then no ancillary data will be sent, causing msg.msg_controllen to be set to 0, which causes 'ip monitor' to indefinitely print "[nsid current]" instead of the real nsid.
Download attachment "fix_msg_control.patch" of type "application/octet-stream" (700 bytes)
Powered by blists - more mailing lists