poll_fd_wait(sock->fd, events);
}
+/* Checks whether this socket caused a wakeup in the previous run of the poll
+ * loop. */
+short int
+nl_sock_woke(const struct nl_sock *sock)
+{
+ return poll_fd_woke(sock->fd);
+}
+
/* Returns the PID associated with this socket. */
uint32_t
nl_sock_pid(const struct nl_sock *sock)
unsigned int *multicast_group, unsigned int fallback)
{
struct nlattr *family_attrs[ARRAY_SIZE(family_policy)];
- struct ofpbuf all_mcs;
+ const struct nlattr *mc;
struct ofpbuf *reply;
- struct nlattr *mc;
unsigned int left;
int error;
goto exit;
}
- nl_attr_get_nested(family_attrs[CTRL_ATTR_MCAST_GROUPS], &all_mcs);
- NL_ATTR_FOR_EACH (mc, left, all_mcs.data, all_mcs.size) {
+ NL_NESTED_FOR_EACH (mc, left, family_attrs[CTRL_ATTR_MCAST_GROUPS]) {
static const struct nl_policy mc_policy[] = {
[CTRL_ATTR_MCAST_GRP_ID] = {.type = NL_A_U32},
[CTRL_ATTR_MCAST_GRP_NAME] = {.type = NL_A_STRING},