diff options
| author | Pablo Neira Ayuso <pablo@netfilter.org> | 2010-05-09 20:17:54 +0200 |
|---|---|---|
| committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2010-05-09 20:17:54 +0200 |
| commit | a5f25889216411ad7492047fafe6de03b8408440 (patch) | |
| tree | 3716ffb20863ecfd4edaf4ff33298c3e88bd1e42 /examples/rtnl-link-dump3.c | |
| parent | cbded627a15baf792465c0cbe960b36cb9408fe2 (diff) | |
| download | libmnl-a5f25889216411ad7492047fafe6de03b8408440.tar.gz libmnl-a5f25889216411ad7492047fafe6de03b8408440.zip | |
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 <pablo@netfilter.org>
Diffstat (limited to 'examples/rtnl-link-dump3.c')
| -rw-r--r-- | examples/rtnl-link-dump3.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/rtnl-link-dump3.c b/examples/rtnl-link-dump3.c index 07acfbd..3c1473e 100644 --- a/examples/rtnl-link-dump3.c +++ b/examples/rtnl-link-dump3.c @@ -31,10 +31,10 @@ static int data_cb(const struct nlmsghdr *nlh, void *data) mnl_attr_for_each(attr, nlh, sizeof(*ifm)) { 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: if (mnl_attr_validate(attr, MNL_TYPE_U32) < 0) { |
