From: Ed Maste Date: Sat, 8 Dec 2012 23:23:12 +0000 (-0500) Subject: vswitchd: Avoid writing to const struct X-Git-Tag: sliver-openvswitch-1.9.90-3~10^2~97 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=8c0f519f6ee6c8cb17c3113401827296e7fa1481;p=sliver-openvswitch.git vswitchd: Avoid writing to const struct When built with Clang, vswitchd segfaulted in ovsrec_open_vswitch_init, from calling memset() on a const struct. Signed-off-by: Ed Maste Signed-off-by: Ben Pfaff --- diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index 53dd2f659..f508d58c5 100644 --- a/vswitchd/bridge.c +++ b/vswitchd/bridge.c @@ -2114,7 +2114,7 @@ bridge_run_fast(void) void bridge_run(void) { - static const struct ovsrec_open_vswitch null_cfg; + static struct ovsrec_open_vswitch null_cfg; const struct ovsrec_open_vswitch *cfg; struct ovsdb_idl_txn *reconf_txn = NULL; struct sset types; @@ -2123,7 +2123,7 @@ bridge_run(void) bool vlan_splinters_changed; struct bridge *br; - ovsrec_open_vswitch_init((struct ovsrec_open_vswitch *) &null_cfg); + ovsrec_open_vswitch_init(&null_cfg); /* (Re)configure if necessary. */ if (!reconfiguring) {