diff options
author | Tom Gundersen <teg@jklm.no> | 2014-04-17 21:32:25 +0200 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2014-04-19 16:47:52 +0200 |
commit | 4e996881b2a24390b534d84aa89ba70401cc7e69 (patch) | |
tree | 4e8788a15bd6bd2d2bb53ebda422299461e27aa5 /src/libsystemd/sd-rtnl/sd-rtnl.c | |
parent | 24a026737da3f108ba56c1c9fe7786b8173376d5 (diff) |
sd-rtnl: message - concatenate multi-part messages from different packets
Diffstat (limited to 'src/libsystemd/sd-rtnl/sd-rtnl.c')
-rw-r--r-- | src/libsystemd/sd-rtnl/sd-rtnl.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/libsystemd/sd-rtnl/sd-rtnl.c b/src/libsystemd/sd-rtnl/sd-rtnl.c index e4d436bb17..8650f550f7 100644 --- a/src/libsystemd/sd-rtnl/sd-rtnl.c +++ b/src/libsystemd/sd-rtnl/sd-rtnl.c @@ -135,6 +135,10 @@ sd_rtnl *sd_rtnl_unref(sd_rtnl *rtnl) { sd_rtnl_message_unref(rtnl->rqueue[i]); free(rtnl->rqueue); + for (i = 0; i < rtnl->rqueue_partial_size; i++) + sd_rtnl_message_unref(rtnl->rqueue_partial[i]); + free(rtnl->rqueue_partial); + for (i = 0; i < rtnl->wqueue_size; i++) sd_rtnl_message_unref(rtnl->wqueue[i]); free(rtnl->wqueue); @@ -226,6 +230,19 @@ int rtnl_rqueue_make_room(sd_rtnl *rtnl) { return 0; } +int rtnl_rqueue_partial_make_room(sd_rtnl *rtnl) { + assert(rtnl); + + if (rtnl->rqueue_partial_size >= RTNL_RQUEUE_MAX) + return -ENOBUFS; + + if (!GREEDY_REALLOC(rtnl->rqueue_partial, rtnl->rqueue_partial_allocated, + rtnl->rqueue_partial_size + 1)) + return -ENOMEM; + + return 0; +} + static int dispatch_rqueue(sd_rtnl *rtnl, sd_rtnl_message **message) { int r; |