From: David Miller Subject: Re: [PATCH net] net: diag: document swapped src/dst in udp_dump_one. Date: Sun, 28 Oct 2018 19:27:44 -0700 (PDT) Message-ID: <20181028.192744.1772180450002120744.davem@davemloft.net> References: <20181029001522.54391-1-lorenzo@google.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, zenczykowski@gmail.com, xemul@parallels.com, dsahern@gmail.com To: lorenzo@google.com Return-path: Received: from shards.monkeyblade.net ([23.128.96.9]:53296 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729054AbeJ2LOW (ORCPT ); Mon, 29 Oct 2018 07:14:22 -0400 In-Reply-To: <20181029001522.54391-1-lorenzo@google.com> Sender: netdev-owner@vger.kernel.org List-ID: From: Lorenzo Colitti Date: Mon, 29 Oct 2018 09:15:22 +0900 > Since its inception, udp_dump_one has had a bug where userspace > needs to swap src and dst addresses and ports in order to find > the socket it wants. This is because it passes the socket source > address to __udp[46]_lib_lookup's saddr argument, but those > functions are intended to find local sockets matching received > packets, so saddr is the remote address, not the local address. > > This can no longer be fixed for backwards compatibility reasons, > so add a brief comment explaining that this is the case. This > will avoid confusion and help ensure SOCK_DIAG implementations > of new protocols don't have the same problem. > > Fixes: a925aa00a55 ("udp_diag: Implement the get_exact dumping functionality") > Signed-off-by: Lorenzo Colitti Applied, thanks.