From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [PATCH net-next] inet_diag: Add equal-operator for ports Date: Tue, 02 Jan 2018 13:54:23 -0500 (EST) Message-ID: <20180102.135423.1243941734307734099.davem@davemloft.net> References: <20171227172758.7241-1-kristian.evensen@gmail.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org To: kristian.evensen@gmail.com Return-path: Received: from shards.monkeyblade.net ([184.105.139.130]:50980 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750944AbeABSyY (ORCPT ); Tue, 2 Jan 2018 13:54:24 -0500 In-Reply-To: <20171227172758.7241-1-kristian.evensen@gmail.com> Sender: netdev-owner@vger.kernel.org List-ID: From: Kristian Evensen Date: Wed, 27 Dec 2017 18:27:58 +0100 > inet_diag currently provides less/greater than or equal operators for > comparing ports when filtering sockets. An equal comparison can be > performed by combining the two existing operators, or a user can for > example request a port range and then do the final filtering in > userspace. However, these approaches both have drawbacks. Implementing > equal using LE/GE causes the size and complexity of a filter to grow > quickly as the number of ports increase, while it on busy machines would > be great if the kernel only returns information about relevant sockets. > > This patch introduces source and destination port equal operators. > INET_DIAG_BC_S_EQ is used to match a source port, INET_DIAG_BC_D_EQ a > destination port, and usage is the same as for the existing port > operators. I.e., the port to match is stored in the no-member of the > next inet_diag_bc_op-struct in the filter. > > Signed-off-by: Kristian Evensen Applied, thank you.