Merge branch 'master' of git://openvswitch.org/openvswitch
[sliver-openvswitch.git] / lib / netdev-vport.c
index bdb0c4d..14b3347 100644 (file)
@@ -413,13 +413,17 @@ set_tunnel_config(struct netdev *dev_, const struct smap *args)
     }
 
     if (tnl_cfg.ipsec) {
+        static struct ovs_mutex mutex = OVS_MUTEX_INITIALIZER;
         static pid_t pid = 0;
+
+        ovs_mutex_lock(&mutex);
         if (pid <= 0) {
             char *file_name = xasprintf("%s/%s", ovs_rundir(),
                                         "ovs-monitor-ipsec.pid");
             pid = read_pidfile(file_name);
             free(file_name);
         }
+        ovs_mutex_unlock(&mutex);
 
         if (pid < 0) {
             VLOG_ERR("%s: IPsec requires the ovs-monitor-ipsec daemon",
@@ -607,7 +611,7 @@ set_patch_config(struct netdev *dev_, const struct smap *args)
 
     free(dev->peer);
     dev->peer = xstrdup(peer);
-
+    netdev_vport_poll_notify(dev);
     return 0;
 }