From 8c0f519f6ee6c8cb17c3113401827296e7fa1481 Mon Sep 17 00:00:00 2001 From: Ed Maste <emaste@freebsd.org> Date: Sat, 8 Dec 2012 18:23:12 -0500 Subject: [PATCH] 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 <emaste@freebsd.org> Signed-off-by: Ben Pfaff <blp@nicira.com> --- vswitchd/bridge.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) { -- 2.47.0