if (n_msgs)
vec_delete (nm->nl_msg_queue, n_msgs, 0);
- NL_INFO ("Processed %u messages", n_msgs);
+ NL_DBG ("Processed %u messages", n_msgs);
return n_msgs;
}
msg_info->msg = msg;
nlmsg_get (msg);
- /* notify process node if netlink notification processing is active */
- if (nm->nl_status == NL_STATUS_NOTIF_PROC)
- {
- vlib_process_signal_event (vlib_get_main (), nl_route_process_node.index,
- NL_EVENT_READ, 0);
- }
-
return 0;
}
if (err != -NLE_AGAIN)
vlib_process_signal_event (vlib_get_main (), nl_route_process_node.index,
NL_EVENT_ERR, 0);
+ else
+ {
+ /* If netlink notification processing is active, signal process node
+ * there were notifications read
+ */
+ if (nm->nl_status == NL_STATUS_NOTIF_PROC)
+ vlib_process_signal_event (
+ vlib_get_main (), nl_route_process_node.index, NL_EVENT_READ, 0);
+ }
return err;
}
nm->sk_route_sync[sock_type] = sk_route = nl_socket_alloc ();
dest_ns_fd = lcp_get_default_ns_fd ();
- if (dest_ns_fd)
+ if (dest_ns_fd > 0)
{
curr_ns_fd = clib_netns_open (NULL /* self */);
- clib_setns (dest_ns_fd);
+ if (clib_setns (dest_ns_fd) == -1)
+ NL_ERROR ("Cannot set destination ns");
}
nl_connect (sk_route, NETLINK_ROUTE);
- if (dest_ns_fd)
+ if (dest_ns_fd > 0)
{
- clib_setns (curr_ns_fd);
- close (curr_ns_fd);
+ if (curr_ns_fd == -1)
+ {
+ NL_ERROR ("No previous ns to set");
+ }
+ else
+ {
+ if (clib_setns (curr_ns_fd) == -1)
+ NL_ERROR ("Cannot set previous ns");
+ close (curr_ns_fd);
+ }
}
NL_INFO ("Opened netlink synchronization socket %d of type %d",