diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2010-04-05 18:06:04 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2010-04-05 18:06:04 +0200 |
commit | 3ece3d60f41b65470ec5ce6c9a0b830e32a84422 (patch) | |
tree | c4c110ccb2b6de6232a436f49c3a042fe97b3711 /src | |
parent | 73661922bc3b7ebf1225d8273147ab4a87757008 (diff) | |
download | libmnl-3ece3d60f41b65470ec5ce6c9a0b830e32a84422.tar.gz libmnl-3ece3d60f41b65470ec5ce6c9a0b830e32a84422.zip |
rename mnl_attr_type_ok() by mnl_attr_type_valid() for consistency
better to rename this function since its return value is not similar
to other _ok() functions, for consistency.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/attr.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -99,21 +99,21 @@ struct nlattr *mnl_attr_next(const struct nlattr *attr, int *len) } /** - * mnl_attr_type_ok - check if the attribute type is valid + * mnl_attr_type_valid - check if the attribute type is valid * @attr: pointer to attribute to be checked * @max: maximum attribute type * * This function allows to check if the attribute type is higher than the * maximum supported type. If the attribute type is invalid, this function - * returns -1 and errno is explicitly set. + * returns -1 and errno is explicitly set. On success, this function returns 1. */ -int mnl_attr_type_ok(const struct nlattr *attr, int max) +int mnl_attr_type_valid(const struct nlattr *attr, int max) { if (mnl_attr_get_type(attr) > max) { errno = EINVAL; return -1; } - return 0; + return 1; } static int __mnl_attr_validate(const struct nlattr *attr, |