* [PATCH conntrackd 1/3] build: don't suppress various warnings
@ 2022-11-24 10:08 Pablo Neira Ayuso
0 siblings, 0 replies; 6+ messages in thread
From: Pablo Neira Ayuso @ 2022-11-24 10:08 UTC (permalink / raw)
To: netfilter-devel
From: Sam James <sam@gentoo.org>
These will become fatal with Clang 16 and GCC 14 anyway, but let's
address the real problem (followup commit).
We do have to keep one wrt yyerror() & const char * though, but
the issue is contained to the code Bison generates.
Closes: https://bugzilla.netfilter.org/show_bug.cgi?id=1637
Signed-off-by: Sam James <sam@gentoo.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
posted via https://bugzilla.netfilter.org/show_bug.cgi?id=1637
src/Makefile.am | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Makefile.am b/src/Makefile.am
index a1a91a0c8df6..2986ab3b4d4f 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -61,7 +61,7 @@ conntrackd_SOURCES += systemd.c
endif
# yacc and lex generate dirty code
-read_config_yy.o read_config_lex.o: AM_CFLAGS += -Wno-missing-prototypes -Wno-missing-declarations -Wno-implicit-function-declaration -Wno-nested-externs -Wno-undef -Wno-redundant-decls -Wno-sign-compare
+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}
--
2.30.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH conntrackd 1/3] build: don't suppress various warnings
@ 2023-05-18 9:17 Pablo Neira Ayuso
2023-05-18 9:18 ` [PATCH conntrack 1/2] conntrack: do not ignore errors coming from the kernel Pablo Neira Ayuso
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Pablo Neira Ayuso @ 2023-05-18 9:17 UTC (permalink / raw)
To: netfilter-devel
From: Sam James <sam@gentoo.org>
These will become fatal with Clang 16 and GCC 14 anyway, but let's
address the real problem (followup commit).
We do have to keep one wrt yyerror() & const char * though, but
the issue is contained to the code Bison generates.
Closes: https://bugzilla.netfilter.org/show_bug.cgi?id=1637
Signed-off-by: Sam James <sam@gentoo.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
posted via https://bugzilla.netfilter.org/show_bug.cgi?id=1637
src/Makefile.am | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Makefile.am b/src/Makefile.am
index a1a91a0c8df6..2986ab3b4d4f 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -61,7 +61,7 @@ conntrackd_SOURCES += systemd.c
endif
# yacc and lex generate dirty code
-read_config_yy.o read_config_lex.o: AM_CFLAGS += -Wno-missing-prototypes -Wno-missing-declarations -Wno-implicit-function-declaration -Wno-nested-externs -Wno-undef -Wno-redundant-decls -Wno-sign-compare
+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}
--
2.30.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH conntrack 1/2] conntrack: do not ignore errors coming from the kernel
2023-05-18 9:17 [PATCH conntrackd 1/3] build: don't suppress various warnings Pablo Neira Ayuso
@ 2023-05-18 9:18 ` Pablo Neira Ayuso
2023-05-18 9:18 ` [PATCH conntrack 2/2] conntrack: do not silence EEXIST error, use NLM_F_EXCL Pablo Neira Ayuso
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Pablo Neira Ayuso @ 2023-05-18 9:18 UTC (permalink / raw)
To: netfilter-devel
Do not ignore error from kernel for command invocation.
e42ea65e9c93 ("conntrack: introduce new -A command") ignores CT_ADD
in print_stats, which should not be required.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
src/conntrack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/conntrack.c b/src/conntrack.c
index 23eaf274a78a..926213a27efc 100644
--- a/src/conntrack.c
+++ b/src/conntrack.c
@@ -2886,7 +2886,7 @@ static int print_stats(const struct ct_cmd *cmd)
fprintf(stderr, "%s v%s (conntrack-tools): ",PROGNAME,VERSION);
fprintf(stderr, exit_msg[cmd->cmd], counter);
if (counter == 0 &&
- !(cmd->command & (CT_LIST | EXP_LIST | CT_ADD)))
+ !(cmd->command & (CT_LIST | EXP_LIST)))
return -1;
}
@@ -3835,7 +3835,7 @@ int main(int argc, char *argv[])
exit_error(OTHER_PROBLEM, "OOM");
do_parse(cmd, argc, argv);
- do_command_ct(argv[0], cmd, sock);
+ res |= do_command_ct(argv[0], cmd, sock);
res = print_stats(cmd);
free(cmd);
}
--
2.30.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH conntrack 2/2] conntrack: do not silence EEXIST error, use NLM_F_EXCL
2023-05-18 9:17 [PATCH conntrackd 1/3] build: don't suppress various warnings Pablo Neira Ayuso
2023-05-18 9:18 ` [PATCH conntrack 1/2] conntrack: do not ignore errors coming from the kernel Pablo Neira Ayuso
@ 2023-05-18 9:18 ` Pablo Neira Ayuso
2023-05-18 9:18 ` [PATCH conntrackd 2/3] network: Fix -Wstrict-prototypes Pablo Neira Ayuso
2023-05-18 9:32 ` [PATCH conntrackd 1/3] build: don't suppress various warnings Pablo Neira Ayuso
3 siblings, 0 replies; 6+ messages in thread
From: Pablo Neira Ayuso @ 2023-05-18 9:18 UTC (permalink / raw)
To: netfilter-devel
Instead of silencing EEXIST error with -A/--add, unset NLM_F_EXCL
netlink flag.
This patch revisits e42ea65e9c93 ("conntrack: introduce new -A
command").
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
src/conntrack.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/conntrack.c b/src/conntrack.c
index 926213a27efc..b9fcf8e44ee2 100644
--- a/src/conntrack.c
+++ b/src/conntrack.c
@@ -3219,6 +3219,7 @@ static int do_command_ct(const char *progname, struct ct_cmd *cmd,
struct nfct_mnl_socket *modifier_sock = &_modifier_sock;
struct nfct_mnl_socket *event_sock = &_event_sock;
struct nfct_filter_dump *filter_dump;
+ uint16_t nl_flags = 0;
int res = 0;
switch(cmd->command) {
@@ -3305,14 +3306,15 @@ static int do_command_ct(const char *progname, struct ct_cmd *cmd,
nfct_set_attr(cmd->tmpl.ct, ATTR_CONNLABELS,
xnfct_bitmask_clone(cmd->tmpl.label_modify));
+ if (cmd->command == CT_CREATE)
+ nl_flags = NLM_F_EXCL;
+
res = nfct_mnl_request(sock, NFNL_SUBSYS_CTNETLINK, cmd->family,
IPCTNL_MSG_CT_NEW,
- NLM_F_CREATE | NLM_F_ACK | NLM_F_EXCL,
+ NLM_F_CREATE | NLM_F_ACK | nl_flags,
NULL, cmd->tmpl.ct, NULL);
if (res >= 0)
counter++;
- else if (errno == EEXIST && cmd->command == CT_ADD)
- res = 0;
break;
case EXP_CREATE:
--
2.30.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH conntrackd 2/3] network: Fix -Wstrict-prototypes
2023-05-18 9:17 [PATCH conntrackd 1/3] build: don't suppress various warnings Pablo Neira Ayuso
2023-05-18 9:18 ` [PATCH conntrack 1/2] conntrack: do not ignore errors coming from the kernel Pablo Neira Ayuso
2023-05-18 9:18 ` [PATCH conntrack 2/2] conntrack: do not silence EEXIST error, use NLM_F_EXCL Pablo Neira Ayuso
@ 2023-05-18 9:18 ` Pablo Neira Ayuso
2023-05-18 9:32 ` [PATCH conntrackd 1/3] build: don't suppress various warnings Pablo Neira Ayuso
3 siblings, 0 replies; 6+ messages in thread
From: Pablo Neira Ayuso @ 2023-05-18 9:18 UTC (permalink / raw)
To: netfilter-devel
From: Sam James <sam@gentoo.org>
Closes: https://bugzilla.netfilter.org/show_bug.cgi?id=1637
Signed-off-by: Sam James <sam@gentoo.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
posted via https://bugzilla.netfilter.org/show_bug.cgi?id=1637
src/network.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/network.c b/src/network.c
index 13db37c96bb0..2560d97bab06 100644
--- a/src/network.c
+++ b/src/network.c
@@ -113,7 +113,7 @@ void nethdr_track_update_seq(uint32_t seq)
STATE_SYNC(last_seq_recv) = seq;
}
-int nethdr_track_is_seq_set()
+int nethdr_track_is_seq_set(void)
{
return local_seq_set;
}
--
2.30.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH conntrackd 1/3] build: don't suppress various warnings
2023-05-18 9:17 [PATCH conntrackd 1/3] build: don't suppress various warnings Pablo Neira Ayuso
` (2 preceding siblings ...)
2023-05-18 9:18 ` [PATCH conntrackd 2/3] network: Fix -Wstrict-prototypes Pablo Neira Ayuso
@ 2023-05-18 9:32 ` Pablo Neira Ayuso
3 siblings, 0 replies; 6+ messages in thread
From: Pablo Neira Ayuso @ 2023-05-18 9:32 UTC (permalink / raw)
To: netfilter-devel
On Thu, May 18, 2023 at 11:17:59AM +0200, Pablo Neira Ayuso wrote:
> From: Sam James <sam@gentoo.org>
>
> These will become fatal with Clang 16 and GCC 14 anyway, but let's
> address the real problem (followup commit).
>
> We do have to keep one wrt yyerror() & const char * though, but
> the issue is contained to the code Bison generates.
Scratch this, this one is old, sorry for the noise.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-05-18 9:32 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-18 9:17 [PATCH conntrackd 1/3] build: don't suppress various warnings Pablo Neira Ayuso
2023-05-18 9:18 ` [PATCH conntrack 1/2] conntrack: do not ignore errors coming from the kernel Pablo Neira Ayuso
2023-05-18 9:18 ` [PATCH conntrack 2/2] conntrack: do not silence EEXIST error, use NLM_F_EXCL Pablo Neira Ayuso
2023-05-18 9:18 ` [PATCH conntrackd 2/3] network: Fix -Wstrict-prototypes Pablo Neira Ayuso
2023-05-18 9:32 ` [PATCH conntrackd 1/3] build: don't suppress various warnings Pablo Neira Ayuso
-- strict thread matches above, loose matches on Subject: below --
2022-11-24 10:08 Pablo Neira Ayuso
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.