* [net PATCH] netfilter: only warn once on wrong seqadj usage
@ 2014-01-04 13:10 Jesper Dangaard Brouer
2014-01-04 13:16 ` Patrick McHardy
2014-01-06 13:23 ` Pablo Neira Ayuso
0 siblings, 2 replies; 4+ messages in thread
From: Jesper Dangaard Brouer @ 2014-01-04 13:10 UTC (permalink / raw)
To: Pablo Neira Ayuso
Cc: Jesper Dangaard Brouer, David S. Miller, netdev, netfilter-devel,
Florian Westphal, Daniel Borkmann, Flavio Leitner
Avoid potentially spamming the kernel log with WARN splash messages
when catching wrong usage of seqadj, by simply using WARN_ONCE.
This is a followup to commit db12cf274353 (netfilter: WARN about
wrong usage of sequence number adjustments)
Suggested-by: Flavio Leitner <fbl@redhat.com>
Suggested-by: Daniel Borkmann <dborkman@redhat.com>
Suggested-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
---
Nitpick found by internal RedHat review process ;-)
net/netfilter/nf_conntrack_seqadj.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/netfilter/nf_conntrack_seqadj.c b/net/netfilter/nf_conntrack_seqadj.c
index b2d38da..f6e2ae9 100644
--- a/net/netfilter/nf_conntrack_seqadj.c
+++ b/net/netfilter/nf_conntrack_seqadj.c
@@ -37,7 +37,7 @@ int nf_ct_seqadj_set(struct nf_conn *ct, enum ip_conntrack_info ctinfo,
return 0;
if (unlikely(!seqadj)) {
- WARN(1, "Wrong seqadj usage, missing nfct_seqadj_ext_add()\n");
+ WARN_ONCE(1, "Missing nfct_seqadj_ext_add() setup call\n");
return 0;
}
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [net PATCH] netfilter: only warn once on wrong seqadj usage
2014-01-04 13:10 [net PATCH] netfilter: only warn once on wrong seqadj usage Jesper Dangaard Brouer
@ 2014-01-04 13:16 ` Patrick McHardy
2014-01-06 7:32 ` Jesper Dangaard Brouer
2014-01-06 13:23 ` Pablo Neira Ayuso
1 sibling, 1 reply; 4+ messages in thread
From: Patrick McHardy @ 2014-01-04 13:16 UTC (permalink / raw)
To: Jesper Dangaard Brouer
Cc: Pablo Neira Ayuso, David S. Miller, netdev, netfilter-devel,
Florian Westphal, Daniel Borkmann, Flavio Leitner
On Sat, Jan 04, 2014 at 02:10:43PM +0100, Jesper Dangaard Brouer wrote:
> Avoid potentially spamming the kernel log with WARN splash messages
> when catching wrong usage of seqadj, by simply using WARN_ONCE.
>
> This is a followup to commit db12cf274353 (netfilter: WARN about
> wrong usage of sequence number adjustments)
>
> Suggested-by: Flavio Leitner <fbl@redhat.com>
> Suggested-by: Daniel Borkmann <dborkman@redhat.com>
> Suggested-by: Florian Westphal <fw@strlen.de>
> Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
> ---
> Nitpick found by internal RedHat review process ;-)
>
> net/netfilter/nf_conntrack_seqadj.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/net/netfilter/nf_conntrack_seqadj.c b/net/netfilter/nf_conntrack_seqadj.c
> index b2d38da..f6e2ae9 100644
> --- a/net/netfilter/nf_conntrack_seqadj.c
> +++ b/net/netfilter/nf_conntrack_seqadj.c
> @@ -37,7 +37,7 @@ int nf_ct_seqadj_set(struct nf_conn *ct, enum ip_conntrack_info ctinfo,
> return 0;
>
> if (unlikely(!seqadj)) {
> - WARN(1, "Wrong seqadj usage, missing nfct_seqadj_ext_add()\n");
> + WARN_ONCE(1, "Missing nfct_seqadj_ext_add() setup call\n");
> return 0;
I missed the patch that added the WARN. Since when do we add runtime checks
for API misuse instead of simply letting it crash?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [net PATCH] netfilter: only warn once on wrong seqadj usage
2014-01-04 13:16 ` Patrick McHardy
@ 2014-01-06 7:32 ` Jesper Dangaard Brouer
0 siblings, 0 replies; 4+ messages in thread
From: Jesper Dangaard Brouer @ 2014-01-06 7:32 UTC (permalink / raw)
To: Patrick McHardy
Cc: Jesper Dangaard Brouer, Pablo Neira Ayuso, David S. Miller,
netdev, netfilter-devel, Florian Westphal, Daniel Borkmann,
Flavio Leitner, lvs-devel@vger.kernel.org
On Sat, 4 Jan 2014 13:16:48 +0000
Patrick McHardy <kaber@trash.net> wrote:
> On Sat, Jan 04, 2014 at 02:10:43PM +0100, Jesper Dangaard Brouer wrote:
> > Avoid potentially spamming the kernel log with WARN splash messages
> > when catching wrong usage of seqadj, by simply using WARN_ONCE.
> >
> > This is a followup to commit db12cf274353 (netfilter: WARN about
> > wrong usage of sequence number adjustments)
> >
> > Suggested-by: Flavio Leitner <fbl@redhat.com>
> > Suggested-by: Daniel Borkmann <dborkman@redhat.com>
> > Suggested-by: Florian Westphal <fw@strlen.de>
> > Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
> > ---
> > Nitpick found by internal RedHat review process ;-)
> >
> > net/netfilter/nf_conntrack_seqadj.c | 2 +-
> > 1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/net/netfilter/nf_conntrack_seqadj.c b/net/netfilter/nf_conntrack_seqadj.c
> > index b2d38da..f6e2ae9 100644
> > --- a/net/netfilter/nf_conntrack_seqadj.c
> > +++ b/net/netfilter/nf_conntrack_seqadj.c
> > @@ -37,7 +37,7 @@ int nf_ct_seqadj_set(struct nf_conn *ct, enum ip_conntrack_info ctinfo,
> > return 0;
> >
> > if (unlikely(!seqadj)) {
> > - WARN(1, "Wrong seqadj usage, missing nfct_seqadj_ext_add()\n");
> > + WARN_ONCE(1, "Missing nfct_seqadj_ext_add() setup call\n");
> > return 0;
>
> I missed the patch that added the WARN. Since when do we add runtime checks
> for API misuse instead of simply letting it crash?
We changed an existing API which broke IPVS. And I think we still have
a use-case in IPVS, which can hit this case/bug, thus I added a stack
dump warning (instead of crashing), so I can catch this use-case and
fix it later.
--
Best regards,
Jesper Dangaard Brouer
MSc.CS, Sr. Network Kernel Developer at Red Hat
Author of http://www.iptv-analyzer.org
LinkedIn: http://www.linkedin.com/in/brouer
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [net PATCH] netfilter: only warn once on wrong seqadj usage
2014-01-04 13:10 [net PATCH] netfilter: only warn once on wrong seqadj usage Jesper Dangaard Brouer
2014-01-04 13:16 ` Patrick McHardy
@ 2014-01-06 13:23 ` Pablo Neira Ayuso
1 sibling, 0 replies; 4+ messages in thread
From: Pablo Neira Ayuso @ 2014-01-06 13:23 UTC (permalink / raw)
To: Jesper Dangaard Brouer
Cc: David S. Miller, netdev, netfilter-devel, Florian Westphal,
Daniel Borkmann, Flavio Leitner
On Sat, Jan 04, 2014 at 02:10:43PM +0100, Jesper Dangaard Brouer wrote:
> Avoid potentially spamming the kernel log with WARN splash messages
> when catching wrong usage of seqadj, by simply using WARN_ONCE.
>
> This is a followup to commit db12cf274353 (netfilter: WARN about
> wrong usage of sequence number adjustments)
>
> Suggested-by: Flavio Leitner <fbl@redhat.com>
> Suggested-by: Daniel Borkmann <dborkman@redhat.com>
> Suggested-by: Florian Westphal <fw@strlen.de>
> Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Applied, thanks Jesper.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-01-06 13:24 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-04 13:10 [net PATCH] netfilter: only warn once on wrong seqadj usage Jesper Dangaard Brouer
2014-01-04 13:16 ` Patrick McHardy
2014-01-06 7:32 ` Jesper Dangaard Brouer
2014-01-06 13:23 ` Pablo Neira Ayuso
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).