datapath: Move Netlink PID for userspace actions from flows to actions.
[sliver-openvswitch.git] / lib / netlink-socket.c
index 3674bac..160edd2 100644 (file)
@@ -668,6 +668,14 @@ nl_sock_wait(const struct nl_sock *sock, short int events)
     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)
@@ -782,9 +790,8 @@ nl_lookup_genl_mcgroup(const char *family_name, const char *group_name,
                        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;
 
@@ -802,8 +809,7 @@ nl_lookup_genl_mcgroup(const char *family_name, const char *group_name,
         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},