diff options
author | Tom Gundersen <teg@jklm.no> | 2014-04-16 18:17:24 +0200 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2014-04-19 16:47:52 +0200 |
commit | 24a026737da3f108ba56c1c9fe7786b8173376d5 (patch) | |
tree | d78c7265107bfb3d5d75c396a9078c7664754683 /src/libsystemd/sd-rtnl/rtnl-message.c | |
parent | 6fc518838cd717f2f8258f8a0cca37797c187a06 (diff) |
sd-rtnl: message - don't put NULL message on rqueue
If nothing interesting was receieved we should not put anything on
the queue.
Diffstat (limited to 'src/libsystemd/sd-rtnl/rtnl-message.c')
-rw-r--r-- | src/libsystemd/sd-rtnl/rtnl-message.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/libsystemd/sd-rtnl/rtnl-message.c b/src/libsystemd/sd-rtnl/rtnl-message.c index 47dcd4a782..ffc19f1bb6 100644 --- a/src/libsystemd/sd-rtnl/rtnl-message.c +++ b/src/libsystemd/sd-rtnl/rtnl-message.c @@ -1194,12 +1194,17 @@ int socket_read_message(sd_rtnl *rtnl) { break; } - r = rtnl_rqueue_make_room(rtnl); - if (r < 0) - return r; + if (first) { + r = rtnl_rqueue_make_room(rtnl); + if (r < 0) + return r; + + rtnl->rqueue[rtnl->rqueue_size ++] = first; + first = NULL; + } - rtnl->rqueue[rtnl->rqueue_size ++] = first; - first = NULL; + if (len) + log_debug("sd-rtnl: discarding %zu bytes of incoming message", len); return ret; } |