From 1db66dbe516b7b57a931969c712c630474ab686f Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 30 Aug 2017 22:56:23 +0200 Subject: [PATCH] monitor: Use extra unsigned variable to make NLMSG_OK macro happy --- monitor/nlmon.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/monitor/nlmon.c b/monitor/nlmon.c index eba6425e..7045ead9 100644 --- a/monitor/nlmon.c +++ b/monitor/nlmon.c @@ -4810,6 +4810,7 @@ static bool nlmon_receive(struct l_io *io, void *user_data) unsigned char buf[8192]; unsigned char control[32]; ssize_t bytes_read; + size_t nlmsg_len; int fd; fd = l_io_get_fd(io); @@ -4858,8 +4859,10 @@ static bool nlmon_receive(struct l_io *io, void *user_data) } } - for (nlmsg = iov.iov_base; NLMSG_OK(nlmsg, (uint32_t) bytes_read); - nlmsg = NLMSG_NEXT(nlmsg, bytes_read)) { + nlmsg_len = bytes_read; + + for (nlmsg = iov.iov_base; NLMSG_OK(nlmsg, nlmsg_len); + nlmsg = NLMSG_NEXT(nlmsg, nlmsg_len)) { switch (proto_type) { case NETLINK_ROUTE: store_netlink(nlmon, tv, proto_type, nlmsg);