From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 87164BE57 for ; Mon, 26 Jun 2023 15:19:17 +0000 (UTC) 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> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20230623112247.1468836-1-Ilia.Gavrilov@infotecs.ru> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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