From edce886c92dc34797a36fd9dd20c530e1799f082 Mon Sep 17 00:00:00 2001
From: Ethan Jackson <ethan@nicira.com>
Date: Wed, 18 Jul 2012 10:56:21 -0700
Subject: [PATCH] bridge: Segfault when missing Open vSwitch table.

The enable_system_stats() function calls smap_get_bool() on the
ovsrec_open_vswitch passed to it.  This was segmentation faulting
when 'null_cfg' defined in bridge_reconfigure() was used because
there was no Open vSwitch table.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
---
 vswitchd/bridge.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
index a36705baa..2c1142b2c 100644
--- a/vswitchd/bridge.c
+++ b/vswitchd/bridge.c
@@ -2018,6 +2018,8 @@ bridge_run(void)
     bool vlan_splinters_changed;
     struct bridge *br;
 
+    ovsrec_open_vswitch_init((struct ovsrec_open_vswitch *) &null_cfg);
+
     /* (Re)configure if necessary. */
     if (!reconfiguring) {
         ovsdb_idl_run(idl);
-- 
2.47.0