From patchwork Sat Aug 26 16:32:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Sowden X-Patchwork-Id: 1826423 X-Patchwork-Delegate: pablo@netfilter.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=azazel.net header.i=@azazel.net header.a=rsa-sha256 header.s=20220717 header.b=fzRQx924; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=netfilter-devel-owner@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by legolas.ozlabs.org (Postfix) with ESMTP id 4RY2Sj5Jzyz1yg9 for ; Sun, 27 Aug 2023 02:33:41 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229789AbjHZQcx (ORCPT ); Sat, 26 Aug 2023 12:32:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229934AbjHZQcs (ORCPT ); Sat, 26 Aug 2023 12:32:48 -0400 Received: from taras.nevrast.org (unknown [IPv6:2a05:d01c:431:aa03:b7e1:333d:ea2a:b14e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C58C310FF for ; Sat, 26 Aug 2023 09:32:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=azazel.net; s=20220717; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=sjZJ8aO/tpxB+Hs+fQMulyJy68WuXmfNT4KMYAxtRUw=; b=fzRQx924KgK54cR4uGM/nEj+zf nwSM7B/2xBpBlgj8If4oqf0c15fL07ZzPDL/gQsxlzug5SqtVCkGqneFAPUhx1ilRzjZvNuooYVZ7 lYBbnh+lmSOAFmf9oEIX0UwvfA70fN/fiR6tcEhuZEFb76Y4n8YrhuQLszqevVqTCXItRdr+oSBmc mFV8zBbCo32nZpGAOhAVncTtmKK+GoZfAyQVXMvTJm5b+hCOV4EnrCqP/QGGsTGtNVnRiKMxSKOVx wtRM/V8KEyZ5FREnxmhGEkDZZY3ckO5l+fWMtzW358JNu1OCl36nYe5NxLTjGnzO9PNmlB+Wa+IcX emJLaB8g==; Received: from [2001:8b0:135f:bcd1:e0cb:4eff:fedf:e608] (helo=ulthar.dreamlands) by taras.nevrast.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1qZwDJ-00DpTC-0g for netfilter-devel@vger.kernel.org; Sat, 26 Aug 2023 17:32:41 +0100 From: Jeremy Sowden To: Netfilter Devel Subject: [PATCH conntrack-tools 1/4] build: reformat and sort `conntrack_LDADD` and `conntrackd_SOURCES` Date: Sat, 26 Aug 2023 17:32:23 +0100 Message-Id: <20230826163226.1104220-2-jeremy@azazel.net> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230826163226.1104220-1-jeremy@azazel.net> References: <20230826163226.1104220-1-jeremy@azazel.net> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2001:8b0:135f:bcd1:e0cb:4eff:fedf:e608 X-SA-Exim-Mail-From: jeremy@azazel.net X-SA-Exim-Scanned: No (on taras.nevrast.org); SAEximRunCond expanded to false X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RDNS_NONE,SPF_HELO_FAIL, SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org Signed-off-by: Jeremy Sowden --- src/Makefile.am | 77 ++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 60 insertions(+), 17 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 2986ab3b4d4f..4ea573abc12d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -11,7 +11,18 @@ BUILT_SOURCES = read_config_yy.h sbin_PROGRAMS = conntrack conntrackd nfct conntrack_SOURCES = conntrack.c -conntrack_LDADD = ../extensions/libct_proto_tcp.la ../extensions/libct_proto_udp.la ../extensions/libct_proto_udplite.la ../extensions/libct_proto_icmp.la ../extensions/libct_proto_icmpv6.la ../extensions/libct_proto_sctp.la ../extensions/libct_proto_dccp.la ../extensions/libct_proto_gre.la ../extensions/libct_proto_unknown.la ${LIBNETFILTER_CONNTRACK_LIBS} ${LIBMNL_LIBS} ${LIBNFNETLINK_LIBS} +conntrack_LDADD = ../extensions/libct_proto_dccp.la \ + ../extensions/libct_proto_gre.la \ + ../extensions/libct_proto_icmp.la \ + ../extensions/libct_proto_icmpv6.la \ + ../extensions/libct_proto_sctp.la \ + ../extensions/libct_proto_tcp.la \ + ../extensions/libct_proto_udp.la \ + ../extensions/libct_proto_udplite.la \ + ../extensions/libct_proto_unknown.la \ + ${LIBMNL_LIBS} \ + ${LIBNETFILTER_CONNTRACK_LIBS} \ + ${LIBNFNETLINK_LIBS} nfct_SOURCES = nfct.c @@ -35,22 +46,54 @@ if HAVE_CTHELPER nfct_LDADD += ${LIBNETFILTER_CTHELPER_LIBS} endif -conntrackd_SOURCES = alarm.c main.c run.c hash.c queue.c queue_tx.c rbtree.c \ - local.c log.c mcast.c udp.c netlink.c vector.c \ - filter.c fds.c event.c process.c origin.c date.c \ - cache.c cache-ct.c cache-exp.c \ - cache_timer.c \ - ctnl.c \ - sync-mode.c sync-alarm.c sync-ftfw.c sync-notrack.c \ - traffic_stats.c stats-mode.c \ - network.c cidr.c \ - build.c parse.c \ - channel.c multichannel.c channel_mcast.c channel_udp.c \ - tcp.c channel_tcp.c \ - external_cache.c external_inject.c \ - internal_cache.c internal_bypass.c \ - read_config_yy.y read_config_lex.l \ - stack.c resync.c +conntrackd_SOURCES = alarm.c \ + build.c \ + cache.c \ + cache-ct.c \ + cache-exp.c \ + cache_timer.c \ + channel.c \ + channel_mcast.c \ + channel_tcp.c \ + channel_udp.c \ + cidr.c \ + ctnl.c \ + date.c \ + event.c \ + external_cache.c \ + external_inject.c \ + fds.c \ + filter.c \ + hash.c \ + internal_bypass.c \ + internal_cache.c \ + local.c \ + log.c \ + main.c \ + mcast.c \ + multichannel.c \ + netlink.c \ + network.c \ + origin.c \ + parse.c \ + process.c \ + queue.c \ + queue_tx.c \ + rbtree.c \ + read_config_lex.l \ + read_config_yy.y \ + resync.c \ + run.c \ + stack.c \ + stats-mode.c \ + sync-alarm.c \ + sync-ftfw.c \ + sync-mode.c \ + sync-notrack.c \ + tcp.c \ + traffic_stats.c \ + udp.c \ + vector.c if HAVE_CTHELPER conntrackd_SOURCES += cthelper.c helpers.c utils.c expect.c From patchwork Sat Aug 26 16:32:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Sowden X-Patchwork-Id: 1826425 X-Patchwork-Delegate: pablo@netfilter.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=azazel.net header.i=@azazel.net header.a=rsa-sha256 header.s=20220717 header.b=WpWWPeqA; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=netfilter-devel-owner@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by legolas.ozlabs.org (Postfix) with ESMTP id 4RY2Sk3BjQz1yhB for ; Sun, 27 Aug 2023 02:33:42 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229929AbjHZQcx (ORCPT ); Sat, 26 Aug 2023 12:32:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229789AbjHZQcr (ORCPT ); Sat, 26 Aug 2023 12:32:47 -0400 Received: from taras.nevrast.org (unknown [IPv6:2a05:d01c:431:aa03:b7e1:333d:ea2a:b14e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC881172D for ; Sat, 26 Aug 2023 09:32:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=azazel.net; s=20220717; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=T0kKHMIWhzE/ppvYpDTI/bJ/sc7WJm2xQIpkTbtUYcg=; b=WpWWPeqAM24tTPShvgJlH4BNrj vSPWFPXPK+CjsABF/Wn+kqMjek5xoKnNGwnfJYo6TS9KK9oiPpy1cM8S9Umtqwb/HvcO/Qmg3fNAq DR9Tzk1VdhwmDFD+2WOKLxBODKpIooV3DUodpX2du4lkKeQYT8sewWUVR4aX2egQmyAHPXrllms4t 5N02ZVOx4x5oT5WpHcJNiSrRyrNbpXacyNgxk2Y5l7rrTyaH1+bdgjNNHM9/aSCiL6OX9yxXA/ha6 QDN3TTtg9fRMok4xnjN2F71EF8EuHk2rWclqdG8g6cmtV9EcrnywptDil4dMIX0IO0EKGVKS4wb8/ ROASRFyw==; Received: from [2001:8b0:135f:bcd1:e0cb:4eff:fedf:e608] (helo=ulthar.dreamlands) by taras.nevrast.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1qZwDJ-00DpTC-0q for netfilter-devel@vger.kernel.org; Sat, 26 Aug 2023 17:32:41 +0100 From: Jeremy Sowden To: Netfilter Devel Subject: [PATCH conntrack-tools 2/4] build: stop suppressing warnings for generated sources Date: Sat, 26 Aug 2023 17:32:24 +0100 Message-Id: <20230826163226.1104220-3-jeremy@azazel.net> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230826163226.1104220-1-jeremy@azazel.net> References: <20230826163226.1104220-1-jeremy@azazel.net> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2001:8b0:135f:bcd1:e0cb:4eff:fedf:e608 X-SA-Exim-Mail-From: jeremy@azazel.net X-SA-Exim-Scanned: No (on taras.nevrast.org); SAEximRunCond expanded to false X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RDNS_NONE,SPF_HELO_FAIL, SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org Contrary to the comment that yacc and lex generate dirty code, none of the warnings being suppressed are in the generated code. Stop suppressing them in order to fix the code. Signed-off-by: Jeremy Sowden --- src/Makefile.am | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 4ea573abc12d..352aa37c9fa4 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -103,9 +103,6 @@ if HAVE_SYSTEMD conntrackd_SOURCES += systemd.c endif -# yacc and lex generate dirty code -read_config_yy.o read_config_lex.o: AM_CFLAGS += -Wno-incompatible-pointer-types -Wno-discarded-qualifiers - conntrackd_LDADD = ${LIBMNL_LIBS} ${LIBNETFILTER_CONNTRACK_LIBS} \ ${libdl_LIBS} ${LIBNFNETLINK_LIBS} From patchwork Sat Aug 26 16:32:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Sowden X-Patchwork-Id: 1826422 X-Patchwork-Delegate: pablo@netfilter.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=azazel.net header.i=@azazel.net header.a=rsa-sha256 header.s=20220717 header.b=Rh+6462y; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=netfilter-devel-owner@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by legolas.ozlabs.org (Postfix) with ESMTP id 4RY2Sh1yrMz1yfX for ; Sun, 27 Aug 2023 02:33:39 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229922AbjHZQcx (ORCPT ); Sat, 26 Aug 2023 12:32:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229929AbjHZQcr (ORCPT ); Sat, 26 Aug 2023 12:32:47 -0400 Received: from taras.nevrast.org (unknown [IPv6:2a05:d01c:431:aa03:b7e1:333d:ea2a:b14e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B7018170F for ; Sat, 26 Aug 2023 09:32:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=azazel.net; s=20220717; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=WkeZsXsiSEUKmiVwiDPEP62KziCvr2e7usw1y3m9QwI=; b=Rh+6462yrPiktDIcfvv0YOIKYM 5j+3Ce3lzOglvMa1STSczl8484YDUL+uECnHJ3BwTVRpOTn5PfnaVxgLW4EXjUJ+CZ0ZzCXPgfc6z lEOC7NeOI0RBnKqchdc9KGKAJm1YhmimgkUxtbeL575g6JPR8O2l6WcTEualVSu/yZfdu0N2seZFY xLkvDr1IS3/4T4v3n608NbgkK/CnmPLImMh9oPaSgRUqKFQf3770Hrycf5KlsGwWbe8vdM7fFzkSi 1U862TBzICaqTYRJKzUMvcQri90l4JcpN8P8yPa+bfYPKNg1UbxTHb6IwmMyWOWvmXXDQg1jnKxW4 fdT1KPKQ==; Received: from [2001:8b0:135f:bcd1:e0cb:4eff:fedf:e608] (helo=ulthar.dreamlands) by taras.nevrast.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1qZwDJ-00DpTC-0z for netfilter-devel@vger.kernel.org; Sat, 26 Aug 2023 17:32:41 +0100 From: Jeremy Sowden To: Netfilter Devel Subject: [PATCH conntrack-tools 3/4] read_config_yy: correct `yyerror` prototype Date: Sat, 26 Aug 2023 17:32:25 +0100 Message-Id: <20230826163226.1104220-4-jeremy@azazel.net> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230826163226.1104220-1-jeremy@azazel.net> References: <20230826163226.1104220-1-jeremy@azazel.net> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2001:8b0:135f:bcd1:e0cb:4eff:fedf:e608 X-SA-Exim-Mail-From: jeremy@azazel.net X-SA-Exim-Scanned: No (on taras.nevrast.org); SAEximRunCond expanded to false X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RDNS_NONE,SPF_HELO_FAIL, SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org Change it to take a `const char *`. It doesn't modify the string and yacc passes string literals, so cause compiler warnings. Signed-off-by: Jeremy Sowden --- src/read_config_yy.y | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/read_config_yy.y b/src/read_config_yy.y index f06c6afff7cb..be927c049056 100644 --- a/src/read_config_yy.y +++ b/src/read_config_yy.y @@ -47,7 +47,7 @@ extern char *yytext; extern int yylineno; int yylex (void); -int yyerror (char *msg); +int yyerror (const char *msg); void yyrestart (FILE *input_file); struct ct_conf conf; @@ -1681,7 +1681,7 @@ helper_policy_expect_timeout: T_HELPER_EXPECT_TIMEOUT T_NUMBER %% int __attribute__((noreturn)) -yyerror(char *msg) +yyerror(const char *msg) { dlog(LOG_ERR, "parsing config file in line (%d), symbol '%s': %s", yylineno, yytext, msg); From patchwork Sat Aug 26 16:32:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Sowden X-Patchwork-Id: 1826424 X-Patchwork-Delegate: pablo@netfilter.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=azazel.net header.i=@azazel.net header.a=rsa-sha256 header.s=20220717 header.b=K17lOxyg; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=netfilter-devel-owner@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by legolas.ozlabs.org (Postfix) with ESMTP id 4RY2Sk0gBDz1ygH for ; Sun, 27 Aug 2023 02:33:42 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229934AbjHZQcy (ORCPT ); Sat, 26 Aug 2023 12:32:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229977AbjHZQcu (ORCPT ); Sat, 26 Aug 2023 12:32:50 -0400 Received: from taras.nevrast.org (unknown [IPv6:2a05:d01c:431:aa03:b7e1:333d:ea2a:b14e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BB9A0171A for ; Sat, 26 Aug 2023 09:32:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=azazel.net; s=20220717; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=kZ7RQ9HpOgaOAAvpxFzYq/VP4NfeZzhiZEGshOzY/YA=; b=K17lOxygXAbXC+AlmO8MtoXOv2 uo3JUN7cRrapuLoFMehRQ/GUmhxVXmI4rFeV5jHIh6c6VQB5rUMQhu68LP9ae0+NBYqvQgaYH5Vkc R3qaqNVfY3ArFXxgkdeLUhvLNg3y61ZJWfMGs+dfVJNn3DV2ELFf5ZWnWzszMPMsaQ9/p9CGSjabD Rduv3xB7yPBNAA7l127Tz46iL3G4krqYfrSpYUdRI7gRM5XO4qy/6DlY91kdmUmUNcFCy7vWJ0oJM KxEvlI1CAGZMTEmGSTN4JsyalPvghqOP78aE3Z2rgSbuAoHZfW4miKhRX2TKLinFQxQkzupZi0YmQ A5Elc33Q==; Received: from [2001:8b0:135f:bcd1:e0cb:4eff:fedf:e608] (helo=ulthar.dreamlands) by taras.nevrast.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1qZwDJ-00DpTC-18 for netfilter-devel@vger.kernel.org; Sat, 26 Aug 2023 17:32:41 +0100 From: Jeremy Sowden To: Netfilter Devel Subject: [PATCH conntrack-tools 4/4] read_config_yy: correct arguments passed to `inet_aton` Date: Sat, 26 Aug 2023 17:32:26 +0100 Message-Id: <20230826163226.1104220-5-jeremy@azazel.net> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230826163226.1104220-1-jeremy@azazel.net> References: <20230826163226.1104220-1-jeremy@azazel.net> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2001:8b0:135f:bcd1:e0cb:4eff:fedf:e608 X-SA-Exim-Mail-From: jeremy@azazel.net X-SA-Exim-Scanned: No (on taras.nevrast.org); SAEximRunCond expanded to false X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RDNS_NONE,SPF_HELO_FAIL, SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org `inet_aton` expects a `struct in_addr *`. In a number of calls, we pass pointers to structs or unions which contain a `struct in_addr` member. Pass pointers to the members instead. In another call, we pass a pointer to a uint32_t. Cast it. Signed-off-by: Jeremy Sowden --- src/read_config_yy.y | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/src/read_config_yy.y b/src/read_config_yy.y index be927c049056..d9b02ab37c5a 100644 --- a/src/read_config_yy.y +++ b/src/read_config_yy.y @@ -246,9 +246,11 @@ multicast_options : multicast_option : T_IPV4_ADDR T_IP { + struct channel_conf *channel_conf = &conf.channel[conf.channel_num]; + __max_dedicated_links_reached(); - if (!inet_aton($2, &conf.channel[conf.channel_num].u.mcast.in)) { + if (!inet_aton($2, &channel_conf->u.mcast.in.inet_addr)) { dlog(LOG_WARNING, "%s is not a valid IPv4 address", $2); free($2); break; @@ -310,9 +312,11 @@ multicast_option : T_IPV6_ADDR T_IP multicast_option : T_IPV4_IFACE T_IP { + struct channel_conf *channel_conf = &conf.channel[conf.channel_num]; + __max_dedicated_links_reached(); - if (!inet_aton($2, &conf.channel[conf.channel_num].u.mcast.ifa)) { + if (!inet_aton($2, &channel_conf->u.mcast.ifa.interface_addr)) { dlog(LOG_WARNING, "%s is not a valid IPv4 address", $2); free($2); break; @@ -423,9 +427,11 @@ udp_options : udp_option : T_IPV4_ADDR T_IP { + struct channel_conf *channel_conf = &conf.channel[conf.channel_num]; + __max_dedicated_links_reached(); - if (!inet_aton($2, &conf.channel[conf.channel_num].u.udp.server.ipv4)) { + if (!inet_aton($2, &channel_conf->u.udp.server.ipv4.inet_addr)) { dlog(LOG_WARNING, "%s is not a valid IPv4 address", $2); free($2); break; @@ -456,9 +462,11 @@ udp_option : T_IPV6_ADDR T_IP udp_option : T_IPV4_DEST_ADDR T_IP { + struct channel_conf *channel_conf = &conf.channel[conf.channel_num]; + __max_dedicated_links_reached(); - if (!inet_aton($2, &conf.channel[conf.channel_num].u.udp.client)) { + if (!inet_aton($2, &channel_conf->u.udp.client.inet_addr)) { dlog(LOG_WARNING, "%s is not a valid IPv4 address", $2); free($2); break; @@ -574,9 +582,11 @@ tcp_options : tcp_option : T_IPV4_ADDR T_IP { + struct channel_conf *channel_conf = &conf.channel[conf.channel_num]; + __max_dedicated_links_reached(); - if (!inet_aton($2, &conf.channel[conf.channel_num].u.tcp.server.ipv4)) { + if (!inet_aton($2, &channel_conf->u.tcp.server.ipv4.inet_addr)) { dlog(LOG_WARNING, "%s is not a valid IPv4 address", $2); free($2); break; @@ -607,9 +617,11 @@ tcp_option : T_IPV6_ADDR T_IP tcp_option : T_IPV4_DEST_ADDR T_IP { + struct channel_conf *channel_conf = &conf.channel[conf.channel_num]; + __max_dedicated_links_reached(); - if (!inet_aton($2, &conf.channel[conf.channel_num].u.tcp.client)) { + if (!inet_aton($2, &channel_conf->u.tcp.client.inet_addr)) { dlog(LOG_WARNING, "%s is not a valid IPv4 address", $2); free($2); break; @@ -1239,7 +1251,7 @@ filter_address_item : T_IPV4_ADDR T_IP } } - if (!inet_aton($2, &ip.ipv4)) { + if (!inet_aton($2, (struct in_addr *) &ip.ipv4)) { dlog(LOG_WARNING, "%s is not a valid IPv4, ignoring", $2); free($2); break;