summaryrefslogtreecommitdiff
path: root/lib/netlink-notifier.c
Commit message (Collapse)AuthorAgeFilesLines
* netlink-notifier: Avoid valgrind possible leak warning.Ben Pfaff2016-07-051-2/+2
| | | | | | | | | | This ensures that pointers to nln_notifiers are to the beginning of the structs instead of to the middle, meaning that valgrind does not consider them "possible" leaks. Reported-by: William Tu <u9012063@gmail.com> Tested-by: William Tu <u9012063@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* netlink-notifier: change message to a less scary oneThadeu Lima de Souza Cascardo2016-06-231-1/+1
| | | | | | | | | | | | "received bad netlink message" may be interpreted as a corrupt netlink message. However, the parse functions may return failure when the message contains unexpected attributes or misses non optional attributes. Indicating the message contained "unexpected contents" will avoid some interpretation that there may be some netlink message corruption. Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com> Cc: Aaron Conole <aconole@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* netlink-notifier: Support multiple groups.Jarno Rajahalme2016-06-131-18/+40
| | | | | | | | | | | | | | | | | | | | | A netlink notifier ('nln') already supports multiple notifiers. This patch allows each of these notifiers to subscribe to a different multicast group. Sharing a single socket for multiple event types (each on their own multicast group) provides serialization of events when reordering of different event types could be problematic. For example, if a 'create' event and 'delete' event are on different netlink multicast group, we may want to process those events in the order in which kernel issued them, rather than in the order we happen to check for them. Moving the multicast group argument from nln_create() to nln_notifier_create() allows each notifier to specify a different multicast group. The parse callback needs to identify the group the message belonged to by returning the corresponding group number, or 0 when an parse error occurs. Signed-off-by: Jarno Rajahalme <jarno@ovn.org> Acked-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
* Move lib/ofpbuf.h to include/openvswitch directoryBen Warren2016-03-301-1/+1
| | | | | | Signed-off-by: Ben Warren <ben@skyportsystems.com> Acked-by: Ryan Moats <rmoats@us.ibm.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* list: Rename all functions in list.h with ovs_ prefix.Ben Warren2016-03-301-5/+5
| | | | | | | This attempts to prevent namespace collisions with other list libraries Signed-off-by: Ben Warren <ben@skyportsystems.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* lib: Move vlog.h to <openvswitch/vlog.h>Thomas Graf2014-12-151-1/+1
| | | | | | | | A new function vlog_insert_module() is introduced to avoid using list_insert() from the vlog.h header. Signed-off-by: Thomas Graf <tgraf@noironetworks.com> Acked-by: Ben Pfaff <blp@nicira.com>
* list: Rename struct list to struct ovs_listThomas Graf2014-12-151-2/+2
| | | | | | | struct list is a common name and can't be used in public headers. Signed-off-by: Thomas Graf <tgraf@noironetworks.com> Acked-by: Ben Pfaff <blp@nicira.com>
* netlink-notifier: Exit loop if nl_sock_recv() returns an errorDaniele Di Proietto2014-07-221-1/+4
| | | | | | | | | | | | | | An error from nl_sock_recv() could mean that there are some issues with the netlink socket (EBADF, ENOTSOCK, ...). Calling nl_sock_recv() in this case is harmful: nln_run() will never return and since we are calling it from the main thread, vswitchd becomes unresponsive. Also, with this commit we avoid calling the notifier callback in case of error (except for ENOBUFS, which means that there could be too many notifications) Suggested-by: Alex Wang <alexw@nicira.com> Signed-off-by: Daniele Di Proietto <ddiproietto@vmware.com> Acked-by: Ben Pfaff <blp@nicira.com> Acked-by: Alex Wang <alexw@nicira.com>
* Replace all uses of strerror() by ovs_strerror(), for thread safety.Ben Pfaff2013-06-281-3/+4
| | | | Signed-off-by: Ben Pfaff <blp@nicira.com>
* Fix misspellings in comments and docs.Andy Hill2013-06-041-1/+1
| | | | | | | | Flagged with: https://github.com/lyda/misspell-check Run with: git ls-files | misspellings -f - Signed-off-by: Andy Hill <hillad@gmail.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* Replace most uses of assert by ovs_assert.Ben Pfaff2013-01-161-2/+1
| | | | | | | | This is a straight search-and-replace, except that I also removed #include <assert.h> from each file where there were no assert calls left. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Ethan Jackson <ethan@nicira.com>
* Global replace of Nicira Networks.Raju Subramanian2012-05-021-1/+1
| | | | | | | | Replaced all instances of Nicira Networks(, Inc) to Nicira, Inc. Feature #10593 Signed-off-by: Raju Subramanian <rsubramanian@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* netlink-socket: Make caller provide message receive buffers.Ben Pfaff2012-04-181-4/+6
| | | | | | | Typically an nl_sock client can stack-allocate the buffer for receiving a Netlink message, which provides a performance boost. Signed-off-by: Ben Pfaff <blp@nicira.com>
* notifiers: Create and destroy nln_notifiers.Ethan Jackson2011-09-161-14/+35
| | | | | | | | This patch changes the interface of netlink-notifier and rtnetlink-link. Now nln_notifiers are allocated and destroyed by the module instead of passed in by callers. This allows the definition of nln_notifier to be hidden, and generally cleans up the code.
* notifiers: Rename run and wait functions.Ethan Jackson2011-09-161-3/+3
| | | | | | | | It makes more sense to call nln_notifier_run() and nln_notifier_wait() simply nln_run() and nln_wait() since they don't operate on notifiers but the entire nln object. This patch changes the nln and the rtnetlink-link modules to the new convention.
* netlink-notifier: Rename rtnetlink code.Ethan Jackson2011-09-011-68/+67
| | | | | | This patch renames the rtnetlink module's code to "nln" for "netlink notifier". Callers are now required to pass in the netlink protocol to he newly renamed nln_create() function.
* lib: Rename rtnetlink.[ch] files.Ethan Jackson2011-09-011-0/+195
The only rtnetlink specific functionality contained in the rtnetlink module is the use of the NETLINK_ROUTE protocol. This can easily be passed in by callers. In preparation for generalization, this patch renames rtnetlink.[ch] to netlink-notifier.[ch]. Future patches will complete the transition.