+ /* if the netlink message was larger than our buffer, realloc
+ * before reading again */
+ if (len > network->netlink_buf_size || msg.msg_flags & MSG_TRUNC) {
+ network->netlink_buf_size *= 2;
+ network->netlink_buf = talloc_realloc(network,
+ network->netlink_buf,
+ char *,
+ network->netlink_buf_size);
+ goto retry;
+ }
+
+ /* otherwise, we're good to read the entire message without PEEK */
+ if (flags == MSG_PEEK) {
+ flags = 0;
+ goto retry;
+ }
+
+ for_each_nlmsg(network->netlink_buf, nlmsg, len)