diff options
Diffstat (limited to 'examples/rtnl-route-dump.c')
-rw-r--r-- | examples/rtnl-route-dump.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/examples/rtnl-route-dump.c b/examples/rtnl-route-dump.c index bc038cd..34c95cf 100644 --- a/examples/rtnl-route-dump.c +++ b/examples/rtnl-route-dump.c @@ -17,10 +17,10 @@ static int data_attr_cb2(const struct nlattr *attr, void *data) { - if (mnl_attr_type_valid(attr, RTAX_MAX) < 0) { - perror("mnl_attr_type_valid"); - return MNL_CB_ERROR; - } + /* skip unsupported attribute in user-space */ + if (mnl_attr_type_valid(attr, RTAX_MAX) < 0) + return MNL_CB_OK; + if (mnl_attr_validate(attr, MNL_TYPE_U32) < 0) { perror("mnl_attr_validate"); return MNL_CB_ERROR; @@ -76,10 +76,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, RTA_MAX) < 0) { - perror("mnl_attr_type_valid"); - return MNL_CB_ERROR; - } + /* skip unsupported attribute in user-space */ + if (mnl_attr_type_valid(attr, RTA_MAX) < 0) + return MNL_CB_OK; switch(type) { case RTA_TABLE: |