Skip to content

Commit

Permalink
route-table-bsd: Stop caching pid
Browse files Browse the repository at this point in the history
The cache here doesn't work anymore as the recent
commit b772066
("route-table: Remove Unregister.")
made this function called before daemonizing,
thus with a different pid.

Signed-off-by: YAMAMOTO Takashi <[email protected]>
Acked-by: Ben Pfaff <[email protected]>
  • Loading branch information
yamt committed Dec 10, 2014
1 parent 56a3eb2 commit 6595fb0
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/route-table-bsd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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)
Expand Down Expand Up @@ -117,7 +116,6 @@ route_table_get_change_seq(void)
void
route_table_init(void)
{
pid = getpid();
}

void
Expand Down

0 comments on commit 6595fb0

Please sign in to comment.