]> git.proxmox.com Git - ovs.git/commitdiff
route-table-bsd: Stop caching pid
authorYAMAMOTO Takashi <yamamoto@valinux.co.jp>
Wed, 3 Dec 2014 09:19:35 +0000 (18:19 +0900)
committerYAMAMOTO Takashi <yamamoto@valinux.co.jp>
Wed, 10 Dec 2014 04:37:58 +0000 (13:37 +0900)
The cache here doesn't work anymore as the recent
commit b772066ffd066d59d9ebce092f6665150723d2ad
("route-table: Remove Unregister.")
made this function called before daemonizing,
thus with a different pid.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Acked-by: Ben Pfaff <blp@nicira.com>
lib/route-table-bsd.c

index b28ab33b8d10657c418336a9fe680913ab1868f0..6d5fe5c93434ba881f62dc1864d89f41428831c3 100644 (file)
@@ -32,8 +32,6 @@
 #include "ovs-router.h"
 #include "util.h"
 
-static int pid;
-
 bool
 ovs_router_lookup(ovs_be32 ip, char name[], ovs_be32 *gw)
 {
@@ -48,6 +46,7 @@ ovs_router_lookup(ovs_be32 ip, char name[], ovs_be32 *gw)
     struct sockaddr *sa;
     static int seq;
     int i, len, namelen, rtsock;
+    const pid_t pid = getpid();
 
     rtsock = socket(PF_ROUTE, SOCK_RAW, 0);
     if (rtsock < 0)
@@ -117,7 +116,6 @@ route_table_get_change_seq(void)
 void
 route_table_init(void)
 {
-    pid = getpid();
 }
 
 void