From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ken-ichirou MATSUZAWA Subject: libmnl [PATCH 1/8] examples: set attr table Date: Sat, 07 Dec 2013 20:21:34 +0900 Message-ID: <87mwkcaou9.wl%chamaken@gmail.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Cc: Pablo Neira Ayuso To: netfilter-devel@vger.kernel.org Return-path: Received: from mail-pd0-f175.google.com ([209.85.192.175]:62830 "EHLO mail-pd0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754263Ab3LGLVq (ORCPT ); Sat, 7 Dec 2013 06:21:46 -0500 Received: by mail-pd0-f175.google.com with SMTP id w10so2433190pde.20 for ; Sat, 07 Dec 2013 03:21:46 -0800 (PST) Sender: netfilter-devel-owner@vger.kernel.org List-ID: Florian adviced rtnl-route-event.c has same problem Signed-off-by: Ken-ichirou MATSUZAWA --- examples/rtnl/rtnl-route-dump.c | 4 ++++ examples/rtnl/rtnl-route-event.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/examples/rtnl/rtnl-route-dump.c b/examples/rtnl/rtnl-route-dump.c index 59e0a9d..33cb2df 100644 --- a/examples/rtnl/rtnl-route-dump.c +++ b/examples/rtnl/rtnl-route-dump.c @@ -13,6 +13,8 @@ static int data_attr_cb2(const struct nlattr *attr, void *data) { + const struct nlattr **tb = data; + /* skip unsupported attribute in user-space */ if (mnl_attr_type_valid(attr, RTAX_MAX) < 0) return MNL_CB_OK; @@ -21,6 +23,8 @@ static int data_attr_cb2(const struct nlattr *attr, void *data) perror("mnl_attr_validate"); return MNL_CB_ERROR; } + + tb[mnl_attr_get_type(attr)] = attr; return MNL_CB_OK; } diff --git a/examples/rtnl/rtnl-route-event.c b/examples/rtnl/rtnl-route-event.c index 16d0563..badba2d 100644 --- a/examples/rtnl/rtnl-route-event.c +++ b/examples/rtnl/rtnl-route-event.c @@ -13,6 +13,8 @@ static int data_attr_cb2(const struct nlattr *attr, void *data) { + const struct nlattr **tb = data; + /* skip unsupported attribute in user-space */ if (mnl_attr_type_valid(attr, RTAX_MAX) < 0) return MNL_CB_OK; @@ -21,6 +23,8 @@ static int data_attr_cb2(const struct nlattr *attr, void *data) perror("mnl_attr_validate"); return MNL_CB_ERROR; } + + tb[mnl_attr_get_type(attr)] = attr; return MNL_CB_OK; } -- 1.8.4.rc3