chiark / gitweb /
rtnl: message - initialize all memory
[elogind.git] / src / libsystemd-rtnl / test-rtnl.c
index 2d2b2373b6a6b5f18f8fdefa52a19167cc36a945..912cc66ba7d7e30e5e985ea040e2578f4e35a6f1 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
+#include <linux/rtnetlink.h>
 #include <netinet/ether.h>
 
 #include "util.h"
 #include "macro.h"
 #include "sd-rtnl.h"
 #include "socket-util.h"
+#include "rtnl-util.h"
 
 static void test_link_configure(sd_rtnl *rtnl, int ifindex) {
         _cleanup_sd_rtnl_message_unref_ sd_rtnl_message *message;
@@ -135,7 +137,7 @@ int main(void) {
         assert(sd_rtnl_message_get_type(r, &type) >= 0);
         assert(type == RTM_NEWLINK);
 
-        assert(sd_rtnl_message_read(m, &type, data) == 0);
+        assert(sd_rtnl_message_read(m, &type, &data) == 0);
         assert((r = sd_rtnl_message_unref(r)) == NULL);
 
         assert(sd_rtnl_send_with_reply_and_block(rtnl, m, -1, &r) == -EPERM);
@@ -151,7 +153,7 @@ int main(void) {
         assert(type == IFLA_MTU);
         assert(*mtu_reply == 0);
 
-        assert(sd_rtnl_message_read(m, &type, data) == 0);
+        assert(sd_rtnl_message_read(m, &type, &data) == 0);
 
         assert(sd_rtnl_send_with_reply_and_block(rtnl, m, -1, &r) >= 0);
         while (sd_rtnl_message_read(r, &type, &data) > 0) {