From bdc967187bab94c802285d99d398a6e3b776f989 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Tue, 10 Jan 2023 09:47:48 +0100 Subject: [PATCH] Apply upstream patch for C99 compatibility issues Related to: --- conntrack-tools-c99.patch | 75 +++++++++++++++++++++++++++++++++++++++ conntrack-tools.spec | 6 +++- 2 files changed, 80 insertions(+), 1 deletion(-) create mode 100644 conntrack-tools-c99.patch diff --git a/conntrack-tools-c99.patch b/conntrack-tools-c99.patch new file mode 100644 index 0000000..35cc5a8 --- /dev/null +++ b/conntrack-tools-c99.patch @@ -0,0 +1,75 @@ +commit 6ce497caac85f53a54e359ca57ad0f9dc379021f +Author: Sam James +Date: Thu Nov 24 07:57:37 2022 +0000 + + config: Fix -Wimplicit-function-declaration + + read_config_yy.c: In function ‘yyparse’: + read_config_yy.c:1765:16: warning: implicit declaration of function ‘yylex’ [-Wimplicit-function-declaration] + 1765 | yychar = yylex (); + | ^~~~~ + read_config_yy.c:1765:16: warning: nested extern declaration of ‘yylex’ [-Wnested-externs] + read_config_yy.y:120:17: warning: implicit declaration of function ‘dlog’ [-Wimplicit-function-declaration] + 120 | dlog(LOG_ERR, "LogFile path is longer than %u characters", + | ^~~~ + read_config_yy.y:120:17: warning: nested extern declaration of ‘dlog’ [-Wnested-externs] + read_config_yy.y:240:14: warning: implicit declaration of function ‘inet_aton’; did you mean ‘in6_pton’? [-Wimplicit-function-declaration] + 240 | if (!inet_aton($2, &conf.channel[conf.channel_num].u.mcast.in)) { + | ^~~~~~~~~ + | in6_pton + + Closes: https://bugzilla.netfilter.org/show_bug.cgi?id=1637 + Signed-off-by: Sam James + Signed-off-by: Pablo Neira Ayuso + +diff --git a/src/read_config_lex.l b/src/read_config_lex.l +index b0d9e61e0e4b92ef..5633da604be6a132 100644 +--- a/src/read_config_lex.l ++++ b/src/read_config_lex.l +@@ -21,6 +21,7 @@ + + #include + ++#include "log.h" + #include "conntrackd.h" + #include "read_config_yy.h" + %} +@@ -169,7 +170,7 @@ notrack [N|n][O|o][T|t][R|r][A|a][C|c][K|k] + %% + + int +-yywrap() ++yywrap(void) + { + return 1; + } +diff --git a/src/read_config_yy.y b/src/read_config_yy.y +index 31109c4de042ccac..e5c57fd934890cbe 100644 +--- a/src/read_config_yy.y ++++ b/src/read_config_yy.y +@@ -31,14 +31,25 @@ + #include "cidr.h" + #include "helper.h" + #include "stack.h" ++#include "log.h" ++ ++#include ++#include ++#include ++ + #include + #include ++ + #include + #include + + extern char *yytext; + extern int yylineno; + ++int yylex (void); ++int yyerror (char *msg); ++void yyrestart (FILE *input_file); ++ + struct ct_conf conf; + + static void __kernel_filter_start(void); diff --git a/conntrack-tools.spec b/conntrack-tools.spec index ac09312..81f8637 100644 --- a/conntrack-tools.spec +++ b/conntrack-tools.spec @@ -1,6 +1,6 @@ Name: conntrack-tools Version: 1.4.6 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Manipulate netfilter connection tracking table and run High Availability License: GPLv2 URL: http://conntrack-tools.netfilter.org/ @@ -10,6 +10,7 @@ Source2: conntrackd.conf Patch01: 0001-build-remove-commented-out-macros-from-configure.ac.patch Patch02: 0002-nfct-remove-lazy-binding.patch +Patch3: conntrack-tools-c99.patch BuildRequires: autogen BuildRequires: autoconf @@ -90,6 +91,9 @@ install -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/conntrackd/ %systemd_postun conntrackd.service %changelog +* Tue Jan 10 2023 Florian Weimer - 1.4.6-5 +- Apply upstream patch for C99 compatibility issues + * Wed Jul 20 2022 Fedora Release Engineering - 1.4.6-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild