From 895839909804d91f6e897bef1c1e32c0b0a9db94 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Thu, 11 Nov 2010 13:57:57 +0100 Subject: nlmsg: use bool for mnl_nlmsg_ok() Signed-off-by: Jan Engelhardt Signed-off-by: Pablo Neira Ayuso --- include/libmnl/libmnl.h | 4 ++-- src/attr.c | 2 +- src/nlmsg.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/libmnl/libmnl.h b/include/libmnl/libmnl.h index 74662d3..c4806d5 100644 --- a/include/libmnl/libmnl.h +++ b/include/libmnl/libmnl.h @@ -49,7 +49,7 @@ extern struct nlmsghdr *mnl_nlmsg_put_header(void *buf); extern void *mnl_nlmsg_put_extra_header(struct nlmsghdr *nlh, size_t size); /* Netlink message iterators */ -extern int mnl_nlmsg_ok(const struct nlmsghdr *nlh, int len); +extern bool mnl_nlmsg_ok(const struct nlmsghdr *nlh, int len); extern struct nlmsghdr *mnl_nlmsg_next(const struct nlmsghdr *nlh, int *len); /* Netlink sequence tracking */ @@ -118,7 +118,7 @@ extern int mnl_attr_validate(const struct nlattr *attr, enum mnl_attr_data_type extern int mnl_attr_validate2(const struct nlattr *attr, enum mnl_attr_data_type type, size_t len); /* TLV iterators */ -extern int mnl_attr_ok(const struct nlattr *attr, int len); +extern bool mnl_attr_ok(const struct nlattr *attr, int len); extern struct nlattr *mnl_attr_next(const struct nlattr *attr, int *len); #define mnl_attr_for_each(attr, nlh, offset) \ diff --git a/src/attr.c b/src/attr.c index c60e1f4..69fda0b 100644 --- a/src/attr.c +++ b/src/attr.c @@ -90,7 +90,7 @@ void *mnl_attr_get_payload(const struct nlattr *attr) * The len parameter may be negative in the case of malformed messages during * attribute iteration, that is why we use a signed integer. */ -int mnl_attr_ok(const struct nlattr *attr, int len) +bool mnl_attr_ok(const struct nlattr *attr, int len) { return len >= (int)sizeof(struct nlattr) && attr->nla_len >= sizeof(struct nlattr) && diff --git a/src/nlmsg.c b/src/nlmsg.c index a3dc0c1..e05fb50 100644 --- a/src/nlmsg.c +++ b/src/nlmsg.c @@ -156,7 +156,7 @@ void *mnl_nlmsg_get_payload_offset(const struct nlmsghdr *nlh, size_t offset) * The len parameter may become negative in malformed messages during message * iteration, that is why we use a signed integer. */ -int mnl_nlmsg_ok(const struct nlmsghdr *nlh, int len) +bool mnl_nlmsg_ok(const struct nlmsghdr *nlh, int len) { return len >= (int)sizeof(struct nlmsghdr) && nlh->nlmsg_len >= sizeof(struct nlmsghdr) && -- cgit v1.2.3