From patchwork Fri Sep 2 01:50:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?6auY5bOw?= X-Patchwork-Id: 665101 X-Patchwork-Delegate: pablo@netfilter.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3sQMcZ59XKz9s1h for ; Fri, 2 Sep 2016 11:54:22 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750781AbcIBByV (ORCPT ); Thu, 1 Sep 2016 21:54:21 -0400 Received: from smtpbg328.qq.com ([14.17.43.160]:54563 "EHLO smtpbg328.qq.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750737AbcIBByV (ORCPT ); Thu, 1 Sep 2016 21:54:21 -0400 X-QQ-mid: bizesmtp15t1472781048tceauydw Received: from localhost.localdomain (unknown [123.56.230.35]) by esmtp4.qq.com (ESMTP) with id ; Fri, 02 Sep 2016 09:50:46 +0800 (CST) X-QQ-SSF: 01400000004000F0FG30000A0000000 X-QQ-FEAT: oP8qruwI8aW/p61vTzUuWSx/oabXLQx7tWyh7LBM7nzhtt5EoOlDIB4pxr6zi Enfpu99vVxzDnrU23UWsTuZb1FeSyVEFO1wzN+7AKOF63dFn73h2t0FTRF62Od0DlvuWQwL h8BZ9xR+9kUvMJCoXu5cQP6EEPWvvZXri/wqENBkBBvF8+iQVcJyQQD4sTt4uWZDxngSD3/ 8Xz9HEd9BNG8vT4RF6TeDF9m1A5pj6PESUtPsHiMyq0Uq/8Ln85te46vyT6XONus= X-QQ-GoodBg: 2 From: fgao@ikuai8.com To: pablo@netfilter.org, netfilter-devel@vger.kernel.org, coreteam@netfilter.org, netdev@vger.kernel.org Cc: gfree.wind@gmail.com, Gao Feng Subject: [PATCH 2/2 nf-next] netfilter: seqadj: print the warning log when fail to add seqadj extension Date: Fri, 2 Sep 2016 09:50:36 +0800 Message-Id: <1472781036-13547-1-git-send-email-fgao@ikuai8.com> X-Mailer: git-send-email 1.9.1 X-QQ-SENDSIZE: 520 Sender: netfilter-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org From: Gao Feng 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 --- 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,