diff options
author | Susant Sahani <ssahani@redhat.com> | 2016-05-03 22:46:50 +0530 |
---|---|---|
committer | Susant Sahani <ssahani@redhat.com> | 2016-05-03 22:46:50 +0530 |
commit | b8cc01a2dbaf63ecd08787226dc39b27242d3d03 (patch) | |
tree | 71d1760e2eab600b8bc408c747a6392e1687bc29 | |
parent | 7178cd76f225a1c48911c68f2ae1855e97ff1397 (diff) |
sd-netlink: fix sd_netlink_message_append_data
Also remove the braces add_rtattr not required.
-rw-r--r-- | src/libsystemd/sd-netlink/netlink-message.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libsystemd/sd-netlink/netlink-message.c b/src/libsystemd/sd-netlink/netlink-message.c index f56798674c..86d8dee867 100644 --- a/src/libsystemd/sd-netlink/netlink-message.c +++ b/src/libsystemd/sd-netlink/netlink-message.c @@ -207,11 +207,11 @@ static int add_rtattr(sd_netlink_message *m, unsigned short type, const void *da * and gives us too little data (so don't do that) */ padding = mempcpy(RTA_DATA(rta), data, data_length); - else { + + else /* if no data was passed, make sure we still initialize the padding note that we can have data_length > 0 (used by some containers) */ padding = RTA_DATA(rta); - } /* make sure also the padding at the end of the message is initialized */ padding_length = (uint8_t*)m->hdr + message_length - (uint8_t*)padding; @@ -343,7 +343,7 @@ int sd_netlink_message_append_data(sd_netlink_message *m, unsigned short type, c assert_return(m, -EINVAL); assert_return(!m->sealed, -EPERM); - r = add_rtattr(m, type, &data, len); + r = add_rtattr(m, type, data, len); if (r < 0) return r; |