2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 22:35:15 +00:00

ipsec gre: Do not reread ovs monitor ipsec pidfile in netdev vport so much

Instead of rereading ovs-monitor-ipsec pidfile in netdev-vport so much.  It's
probably only necessary to check once if ovs-monitor-ipsec is running,
and then cache the result.  If the result is negative, then it may be
worthwhile to try again the next time someone tries to configure an ipsec
tunnel.

Signed-off-by: Arun Sharma <arun.sharma@calsoftinc.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
Arun Sharma
2012-07-02 18:30:21 -07:00
committed by Ben Pfaff
parent 5796d9cf85
commit 2a586a5c13

View File

@@ -681,10 +681,14 @@ parse_tunnel_config(const char *name, const char *type,
}
if (is_ipsec) {
char *file_name = xasprintf("%s/%s", ovs_rundir(),
"ovs-monitor-ipsec.pid");
pid_t pid = read_pidfile(file_name);
free(file_name);
static pid_t pid = 0;
if (pid == 0) {
char *file_name = xasprintf("%s/%s", ovs_rundir(),
"ovs-monitor-ipsec.pid");
pid = read_pidfile(file_name);
free(file_name);
}
if (pid < 0) {
VLOG_ERR("%s: IPsec requires the ovs-monitor-ipsec daemon",
name);