From a5f25889216411ad7492047fafe6de03b8408440 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Sun, 9 May 2010 20:17:54 +0200 Subject: relax mnl_attr_type_valid() checkings and change errno value This patch relaxes strict attribute checkings in the example files. I have also changed the errno value, now it's EOPNOTSUPP instead of EINVAL. Signed-off-by: Pablo Neira Ayuso --- examples/rtnl-link-dump.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'examples/rtnl-link-dump.c') diff --git a/examples/rtnl-link-dump.c b/examples/rtnl-link-dump.c index 4bbc997..8bce803 100644 --- a/examples/rtnl-link-dump.c +++ b/examples/rtnl-link-dump.c @@ -19,10 +19,9 @@ static int data_attr_cb(const struct nlattr *attr, void *data) const struct nlattr **tb = (const struct nlattr **)data; int type = mnl_attr_get_type(attr); - if (mnl_attr_type_valid(attr, IFLA_MAX) < 0) { - perror("mnl_attr_type_valid"); - return MNL_CB_ERROR; - } + /* skip unsupported attribute in user-space */ + if (mnl_attr_type_valid(attr, IFLA_MAX) < 0) + return MNL_CB_OK; switch(type) { case IFLA_MTU: -- cgit v1.2.3