summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-12-08 18:36:16 +0100
committerTom Gundersen <teg@jklm.no>2014-12-08 18:38:55 +0100
commit0e707326fcecd3968efa7dc827123032f1b2cb61 (patch)
treea7725fe9c58bf4dab846da9bbc84c2c647c1a21a
parent935c0d26f7ca748e78a02f524908ede696dc4cda (diff)
sd-rtnl: fix bogus warning about dropping 20 bytes from multi-part messages
Nothing was being dropped, we just failed to account for the NLMSG_DONE.
-rw-r--r--src/libsystemd/sd-rtnl/rtnl-message.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libsystemd/sd-rtnl/rtnl-message.c b/src/libsystemd/sd-rtnl/rtnl-message.c
index 1112aa6b90..ac920b2d30 100644
--- a/src/libsystemd/sd-rtnl/rtnl-message.c
+++ b/src/libsystemd/sd-rtnl/rtnl-message.c
@@ -1380,7 +1380,7 @@ int socket_read_message(sd_rtnl *rtnl) {
}
}
- for (new_msg = rtnl->rbuffer; NLMSG_OK(new_msg, len); new_msg = NLMSG_NEXT(new_msg, len)) {
+ for (new_msg = rtnl->rbuffer; NLMSG_OK(new_msg, len) && !done; new_msg = NLMSG_NEXT(new_msg, len)) {
_cleanup_rtnl_message_unref_ sd_rtnl_message *m = NULL;
const NLType *nl_type;
@@ -1395,7 +1395,8 @@ int socket_read_message(sd_rtnl *rtnl) {
if (new_msg->nlmsg_type == NLMSG_DONE) {
/* finished reading multi-part message */
done = true;
- break;
+
+ continue;
}
/* check that we support this message type */