[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <9aff4da8-fc89-20c7-7240-780ebc890171@6wind.com>
Date: Thu, 15 Jul 2021 17:15:52 +0200
From: Nicolas Dichtel <nicolas.dichtel@...nd.com>
To: Lahav Schlesinger <lschlesinger@...venets.com>, dsahern@...il.com
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH] ipmonitor: Fix recvmsg with ancillary data
Le 15/07/2021 à 16:38, Lahav Schlesinger a écrit :
> 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.
>
> Fixes: 449b824ad196 ("ipmonitor: allows to monitor in several netns")
> Cc: Nicolas Dichtel <nicolas.dichtel@...nd.com>
> Signed-off-by: Lahav Schlesinger <lschlesinger@...venets.com>
Acked-by: Nicolas Dichtel <nicolas.dichtel@...nd.com>
Powered by blists - more mailing lists