diff options
author | Tom Gundersen <teg@jklm.no> | 2014-04-19 20:32:01 +0200 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2014-04-19 20:32:01 +0200 |
commit | d4ef4f46cfa393f65c7312a18bc798db43018cd0 (patch) | |
tree | 5e0691eb0f25a1ad67e97911112bebbb06c47dc1 /src/libsystemd/sd-rtnl/rtnl-message.c | |
parent | 6916ec29afd488d91e7e0fcbcc2e006b4e5f28df (diff) |
sd-rtnl: socet_read_message - make sure we only shrink the partial rqueue when processing multi-part message
Diffstat (limited to 'src/libsystemd/sd-rtnl/rtnl-message.c')
-rw-r--r-- | src/libsystemd/sd-rtnl/rtnl-message.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libsystemd/sd-rtnl/rtnl-message.c b/src/libsystemd/sd-rtnl/rtnl-message.c index 3362958f36..a5b09eddad 100644 --- a/src/libsystemd/sd-rtnl/rtnl-message.c +++ b/src/libsystemd/sd-rtnl/rtnl-message.c @@ -1226,16 +1226,16 @@ int socket_read_message(sd_rtnl *rtnl) { if (r < 0) return r; - if (i < rtnl->rqueue_partial_size) { + rtnl->rqueue[rtnl->rqueue_size ++] = first; + first = NULL; + + if (multi_part && (i < rtnl->rqueue_partial_size)) { /* remove the message form the partial read queue */ memmove(rtnl->rqueue_partial + i,rtnl->rqueue_partial + i + 1, sizeof(sd_rtnl_message*) * (rtnl->rqueue_partial_size - i - 1)); rtnl->rqueue_partial_size --; } - rtnl->rqueue[rtnl->rqueue_size ++] = first; - first = NULL; - return 1; } else { /* we only got a partial multi-part message, push it on the |