diff mbox series

[net-next,v1] netfilter: cttimeout: remove 'l3num' attr check

Message ID 20240531012847.2390529-1-linma@zju.edu.cn (mailing list archive)
State Awaiting Upstream
Delegated to: Netdev Maintainers
Headers show
Series [net-next,v1] netfilter: cttimeout: remove 'l3num' attr check | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 902 this patch: 902
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 8 of 8 maintainers
netdev/build_clang success Errors and warnings before: 906 this patch: 906
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 906 this patch: 906
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 9 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-05-31--09-00 (tests: 1040)

Commit Message

Lin Ma May 31, 2024, 1:28 a.m. UTC
After commit dd2934a95701 ("netfilter: conntrack: remove l3->l4 mapping
information"), the attribute of type `CTA_TIMEOUT_L3PROTO` is not used
any more in function cttimeout_default_set.

However, the previous commit ea9cf2a55a7b ("netfilter: cttimeout: remove
set but not used variable 'l3num'") forgot to remove the attribute
present check when removing the related variable.

This commit removes that check to ensure consistency.

Signed-off-by: Lin Ma <linma@zju.edu.cn>
---
 net/netfilter/nfnetlink_cttimeout.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Simon Horman June 4, 2024, 4:48 p.m. UTC | #1
On Fri, May 31, 2024 at 09:28:47AM +0800, Lin Ma wrote:
> After commit dd2934a95701 ("netfilter: conntrack: remove l3->l4 mapping
> information"), the attribute of type `CTA_TIMEOUT_L3PROTO` is not used
> any more in function cttimeout_default_set.
> 
> However, the previous commit ea9cf2a55a7b ("netfilter: cttimeout: remove
> set but not used variable 'l3num'") forgot to remove the attribute
> present check when removing the related variable.
> 
> This commit removes that check to ensure consistency.
> 
> Signed-off-by: Lin Ma <linma@zju.edu.cn>

Reviewed-by: Simon Horman <horms@kernel.org>
Pablo Neira Ayuso June 26, 2024, 11:33 a.m. UTC | #2
On Fri, May 31, 2024 at 09:28:47AM +0800, Lin Ma wrote:
> After commit dd2934a95701 ("netfilter: conntrack: remove l3->l4 mapping
> information"), the attribute of type `CTA_TIMEOUT_L3PROTO` is not used
> any more in function cttimeout_default_set.
> 
> However, the previous commit ea9cf2a55a7b ("netfilter: cttimeout: remove
> set but not used variable 'l3num'") forgot to remove the attribute
> present check when removing the related variable.
> 
> This commit removes that check to ensure consistency.

Applied to nf-next, thanks
diff mbox series

Patch

diff --git a/net/netfilter/nfnetlink_cttimeout.c b/net/netfilter/nfnetlink_cttimeout.c
index f466af4f8531..eab4f476b47f 100644
--- a/net/netfilter/nfnetlink_cttimeout.c
+++ b/net/netfilter/nfnetlink_cttimeout.c
@@ -366,8 +366,7 @@  static int cttimeout_default_set(struct sk_buff *skb,
 	__u8 l4num;
 	int ret;
 
-	if (!cda[CTA_TIMEOUT_L3PROTO] ||
-	    !cda[CTA_TIMEOUT_L4PROTO] ||
+	if (!cda[CTA_TIMEOUT_L4PROTO] ||
 	    !cda[CTA_TIMEOUT_DATA])
 		return -EINVAL;