From: Jan Engelhardt <jengelh@medozas.de>
To: pablo@netfilter.org
Cc: netfilter-devel@vger.kernel.org
Subject: [PATCH 3/5] nlmsg: use bool for all _ok functions
Date: Thu, 11 Nov 2010 00:08:02 +0100 [thread overview]
Message-ID: <1289430485-16467-4-git-send-email-jengelh@medozas.de> (raw)
In-Reply-To: <1289430485-16467-1-git-send-email-jengelh@medozas.de>
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
---
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 37c502a..43388e5 100644
--- a/include/libmnl/libmnl.h
+++ b/include/libmnl/libmnl.h
@@ -52,7 +52,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 */
@@ -121,7 +121,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 f89a9ec..b5c5c29 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) &&
--
1.7.1
next prev parent reply other threads:[~2010-11-10 23:08 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-10 23:07 libmnl misc patches Nov 11 Jan Engelhardt
2010-11-10 23:08 ` [PATCH 1/5] socket: constify a struct sockaddr_nl Jan Engelhardt
2010-11-11 12:56 ` Pablo Neira Ayuso
2010-11-10 23:08 ` [PATCH 2/5] include: use C++ headers in C++ mode Jan Engelhardt
2010-11-11 12:57 ` Pablo Neira Ayuso
2010-11-11 12:59 ` Jan Engelhardt
2010-11-11 13:15 ` Pablo Neira Ayuso
2010-11-13 18:19 ` Jan Engelhardt
2010-11-16 10:04 ` Pablo Neira Ayuso
2013-06-07 8:35 ` Thomas Jarosch
2013-06-08 13:38 ` Jan Engelhardt
2010-11-10 23:08 ` Jan Engelhardt [this message]
2010-11-11 12:59 ` [PATCH 3/5] nlmsg: use bool for all _ok functions Pablo Neira Ayuso
2010-11-10 23:08 ` [PATCH 4/5] attr: remove redundant check for NULL Jan Engelhardt
2010-11-11 13:02 ` Pablo Neira Ayuso
2010-11-10 23:08 ` [PATCH 5/5] attr: avoid multiple definition of hidden variable Jan Engelhardt
2010-11-11 13:08 ` Pablo Neira Ayuso
2010-11-11 13:25 ` Jan Engelhardt
2010-11-11 17:47 ` Pablo Neira Ayuso
2010-11-11 20:53 ` Jan Engelhardt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1289430485-16467-4-git-send-email-jengelh@medozas.de \
--to=jengelh@medozas.de \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).