From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A7051EB64DD for ; Mon, 26 Jun 2023 15:19:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229935AbjFZPTS (ORCPT ); Mon, 26 Jun 2023 11:19:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229677AbjFZPTR (ORCPT ); Mon, 26 Jun 2023 11:19:17 -0400 Received: from mail.netfilter.org (mail.netfilter.org [217.70.188.207]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id BEE1818D; Mon, 26 Jun 2023 08:19:16 -0700 (PDT) Date: Mon, 26 Jun 2023 17:19:13 +0200 From: Pablo Neira Ayuso To: Gavrilov Ilia Cc: Jozsef Kadlecsik , Florian Westphal , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Patrick McHardy , "netfilter-devel@vger.kernel.org" , "coreteam@netfilter.org" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "lvc-project@linuxtesting.org" , Simon Horman Subject: Re: [PATCH net] netfilter: nf_conntrack_sip: fix the ct_sip_parse_numerical_param() return value. Message-ID: References: <20230623112247.1468836-1-Ilia.Gavrilov@infotecs.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20230623112247.1468836-1-Ilia.Gavrilov@infotecs.ru> Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org On Fri, Jun 23, 2023 at 11:23:46AM +0000, Gavrilov Ilia wrote: > From: "Ilia.Gavrilov" > > ct_sip_parse_numerical_param() returns only 0 or 1 now. > But process_register_request() and process_register_response() imply > checking for a negative value if parsing of a numerical header parameter > failed. > The invocation in nf_nat_sip() looks correct: > if (ct_sip_parse_numerical_param(...) > 0 && > ...) { ... } > > Make the return value of the function ct_sip_parse_numerical_param() > a tristate to fix all the cases > a) return 1 if value is found; *val is set > b) return 0 if value is not found; *val is unchanged > c) return -1 on error; *val is undefined Applied to nf.git