Respin "Make vconns keep track of their names and include them in log messages."
[openvswitch] / lib / vconn-netlink.c
index ca1f93d5ae07a7dc176c5646b8acbbb378c4f1ff..4f609bb3344c02646df3b4d06eed6660593345e8 100644 (file)
@@ -31,6 +31,7 @@
  * derivatives without specific, written prior permission.
  */
 
+#include <config.h>
 #include "vconn.h"
 #include <arpa/inet.h>
 #include <assert.h>
@@ -50,6 +51,7 @@
 #include "socket-util.h"
 #include "util.h"
 #include "openflow.h"
+#include "vconn-provider.h"
 
 #include "vlog.h"
 #define THIS_MODULE VLM_VCONN_NETLINK
@@ -77,12 +79,12 @@ netlink_open(const char *name, char *suffix, struct vconn **vconnp)
 
     subscribe = 1;
     if (sscanf(suffix, "%d:%d", &dp_idx, &subscribe) < 1) {
-        fatal(0, "%s: syntax error", name);
+        error(0, "%s: syntax error", name);
+        return EAFNOSUPPORT;
     }
 
     netlink = xmalloc(sizeof *netlink);
-    netlink->vconn.class = &netlink_vconn_class;
-    netlink->vconn.connect_status = 0;
+    vconn_init(&netlink->vconn, &netlink_vconn_class, 0, 0, name);
     retval = dpif_open(dp_idx, subscribe, &netlink->dp);
     if (retval) {
         free(netlink);