netlink-notifier: Avoid valgrind possible leak warning.
authorBen Pfaff <blp@ovn.org>
Tue, 5 Jul 2016 15:33:05 +0000 (08:33 -0700)
committerBen Pfaff <blp@ovn.org>
Tue, 5 Jul 2016 15:33:13 +0000 (08:33 -0700)
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>
lib/netlink-notifier.c

index 0867952..3acded4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2010, 2011, 2012, 2013 Nicira, Inc.
+ * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2016 Nicira, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -46,9 +46,9 @@ struct nln {
 };
 
 struct nln_notifier {
+    struct ovs_list node;        /* In struct nln's 'all_notifiers' list. */
     struct nln *nln;             /* Parent nln. */
 
-    struct ovs_list node;
     int multicast_group;         /* Multicast group we listen on. */
     nln_notify_func *cb;
     void *aux;