diff options
author | Ethan Jackson <ethan@nicira.com> | 2011-09-14 11:26:21 -0700 |
---|---|---|
committer | Ethan Jackson <ethan@nicira.com> | 2011-09-16 11:22:30 -0700 |
commit | 8f4a4df5e354721ef8ae47f1e8aa8af55d10aa38 (patch) | |
tree | 7fcb5b5b7e509a24c677b44e034584007360a556 /lib | |
parent | 7fad428207c1d2ef50878da0740ee94dd57eb8bf (diff) |
dpif-linux: Open dpif despite notifier failures.
Before this patch, if dpif-linux failed to register a notifier it
would give up opening the datapath entirely. This seems draconian
as a dpif can still perform the majority of its intended
functionality without vport notifications.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/dpif-linux.c | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/lib/dpif-linux.c b/lib/dpif-linux.c index 549c7e44..150c410e 100644 --- a/lib/dpif-linux.c +++ b/lib/dpif-linux.c @@ -160,7 +160,7 @@ static struct nl_sock *genl_sock; static struct nln *nln = NULL; static int dpif_linux_init(void); -static int open_dpif(const struct dpif_linux_dp *, struct dpif **); +static void open_dpif(const struct dpif_linux_dp *, struct dpif **); static bool dpif_linux_nln_parse(struct ofpbuf *, void *); static void dpif_linux_port_changed(const void *vport, void *dpif); @@ -243,13 +243,13 @@ dpif_linux_open(const struct dpif_class *class OVS_UNUSED, const char *name, if (error) { return error; } - error = open_dpif(&dp, dpifp); - ofpbuf_delete(buf); - return error; + open_dpif(&dp, dpifp); + ofpbuf_delete(buf); + return 0; } -static int +static void open_dpif(const struct dpif_linux_dp *dp, struct dpif **dpifp) { struct dpif_linux *dpif; @@ -258,9 +258,6 @@ open_dpif(const struct dpif_linux_dp *dp, struct dpif **dpifp) dpif = xmalloc(sizeof *dpif); dpif->port_notifier = nln_notifier_create(nln, dpif_linux_port_changed, dpif); - if (!dpif->port_notifier) { - goto error_free; - } dpif_init(&dpif->dpif, &dpif_linux_class, dp->name, dp->dp_ifindex, dp->dp_ifindex); @@ -281,11 +278,6 @@ open_dpif(const struct dpif_linux_dp *dp, struct dpif **dpifp) for (i = 1; i < LRU_MAX_PORTS; i++) { dpif_linux_push_port(dpif, i); } - return 0; - -error_free: - free(dpif); - return EINVAL; } static void |