chiark / gitweb /
rtnl: add callback support
[elogind.git] / src / libsystemd-rtnl / rtnl-message.c
index 800bf2354caa5583b047f8a31086d630fe824613..06c7622f7c936bf9dd7c9f6077156176d308cc35 100644 (file)
@@ -320,6 +320,7 @@ int sd_rtnl_message_append(sd_rtnl_message *m, unsigned short type, const void *
                                 case IFLA_IFALIAS:
                                 case IFLA_QDISC:
                                         return add_rtattr(m, type, data, strlen(data) + 1);
+                                case IFLA_MASTER:
                                 case IFLA_MTU:
                                 case IFLA_LINK:
                                         return add_rtattr(m, type, data, sizeof(uint32_t));
@@ -614,8 +615,8 @@ int socket_read_message(sd_rtnl *nl, sd_rtnl_message **ret) {
         else if ((size_t) k < sizeof(struct nlmsghdr) ||
                         (size_t) k < m->hdr->nlmsg_len)
                 k = -EIO; /* too small (we do accept too big though) */
-        else if (m->hdr->nlmsg_pid != nl->sockaddr.nl.nl_pid)
-                k = 0; /* not for us */
+        else if (m->hdr->nlmsg_pid && m->hdr->nlmsg_pid != nl->sockaddr.nl.nl_pid)
+                k = 0; /* not broadcast and not for us */
 
         if (k > 0)
                 switch (m->hdr->nlmsg_type) {