From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757255AbdEDUGg (ORCPT ); Thu, 4 May 2017 16:06:36 -0400 Received: from gateway30.websitewelcome.com ([192.185.150.24]:45732 "EHLO gateway30.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757220AbdEDUGe (ORCPT ); Thu, 4 May 2017 16:06:34 -0400 X-Greylist: delayed 1333 seconds by postgrey-1.27 at vger.kernel.org; Thu, 04 May 2017 16:06:33 EDT Date: Thu, 4 May 2017 14:44:16 -0500 From: "Gustavo A. R. Silva" To: "David S. Miller" , Alexey Kuznetsov , James Morris , Hideaki YOSHIFUJI , Patrick McHardy Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, "Gustavo A. R. Silva" , Joe Perches Subject: [PATCH] net: ipv4: add code comment for clarification Message-ID: <20170504194415.GA29391@embeddedgus> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170504142432.Horde.g9y26Ryxbtg1EIl_cnsdbbw@gator4166.hostgator.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator4166.hostgator.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - embeddedor.com X-BWhitelist: no X-Source-IP: 177.237.186.200 X-Exim-ID: 1d6Mfg-000CFx-OP X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: (embeddedgus) [177.237.186.200]:28739 X-Source-Auth: garsilva@embeddedor.com X-Email-Count: 36 X-Source-Cap: Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add code comment to make it clear that the position of the arguments req->id.idiag_dport and req->id.idiag_sport is a locked in behavior and it should not be changed. Addresses-Coverity-ID: 1357474 Cc: David Miller Cc: Joe Perches Signed-off-by: Gustavo A. R. Silva --- net/ipv4/inet_diag.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c index 3828b3a..841800b 100644 --- a/net/ipv4/inet_diag.c +++ b/net/ipv4/inet_diag.c @@ -389,6 +389,12 @@ static int sk_diag_fill(struct sock *sk, struct sk_buff *skb, nlmsg_flags, unlh, net_admin); } +/* + * Ignore the position of the arguments req->id.idiag_dport and + * req->id.idiag_sport in both calls to inet_lookup() and inet6_lookup() + * functions, once this is a locked in behavior exposed to user space. + * Changing this will break things for people. + */ struct sock *inet_diag_find_one_icsk(struct net *net, struct inet_hashinfo *hashinfo, const struct inet_diag_req_v2 *req) -- 2.5.0