netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/2 nf-next] netfilter: seqadj: print the warning log when fail to add seqadj extension
@ 2016-09-02  1:50 fgao
  2016-09-02  6:54 ` Florian Westphal
  0 siblings, 1 reply; 2+ messages in thread
From: fgao @ 2016-09-02  1:50 UTC (permalink / raw)
  To: pablo, netfilter-devel, coreteam, netdev; +Cc: gfree.wind, Gao Feng

From: Gao Feng <fgao@ikuai8.com>

Print the warning log when fail to add seqadj extension like
nf_ct_acct_ext_add does. It could be helpful to find the problem.

Signed-off-by: Gao Feng <fgao@ikuai8.com>
---
 include/net/netfilter/nf_conntrack_seqadj.h | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/include/net/netfilter/nf_conntrack_seqadj.h b/include/net/netfilter/nf_conntrack_seqadj.h
index 4b33629..d548b9c 100644
--- a/include/net/netfilter/nf_conntrack_seqadj.h
+++ b/include/net/netfilter/nf_conntrack_seqadj.h
@@ -27,7 +27,13 @@ static inline struct nf_conn_seqadj *nfct_seqadj(const struct nf_conn *ct)
 
 static inline struct nf_conn_seqadj *nfct_seqadj_ext_add(struct nf_conn *ct)
 {
-	return nf_ct_ext_add(ct, NF_CT_EXT_SEQADJ, GFP_ATOMIC);
+	struct nf_conn_seqadj *seqadj = nf_ct_ext_add(ct, NF_CT_EXT_SEQADJ,
+						      GFP_ATOMIC);
+
+	if (!seqadj)
+		pr_warn("failed to add seqadj extension area");
+
+	return seqadj;
 }
 
 int nf_ct_seqadj_init(struct nf_conn *ct, enum ip_conntrack_info ctinfo,
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 2/2 nf-next] netfilter: seqadj: print the warning log when fail to add seqadj extension
  2016-09-02  1:50 [PATCH 2/2 nf-next] netfilter: seqadj: print the warning log when fail to add seqadj extension fgao
@ 2016-09-02  6:54 ` Florian Westphal
  0 siblings, 0 replies; 2+ messages in thread
From: Florian Westphal @ 2016-09-02  6:54 UTC (permalink / raw)
  To: fgao; +Cc: pablo, netfilter-devel, coreteam, netdev, gfree.wind

fgao@ikuai8.com <fgao@ikuai8.com> wrote:
> From: Gao Feng <fgao@ikuai8.com>
> 
> Print the warning log when fail to add seqadj extension like
> nf_ct_acct_ext_add does. It could be helpful to find the problem.

Failure to add ext area means that we're pretty much completely out
of memory.  There is nothing the user could do, so pr_warn (or any other
log level ...) is not really helpful.

Besides, memory subsystem will already print diagnostic information in
that case.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-09-02  6:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-02  1:50 [PATCH 2/2 nf-next] netfilter: seqadj: print the warning log when fail to add seqadj extension fgao
2016-09-02  6:54 ` Florian Westphal

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).