Message ID | 1466801210-27561-1-git-send-email-diproiettod@vmware.com |
---|---|
State | Superseded |
Headers | show |
Please discard this, Ben just reverted the change that introduced this. On 24/06/2016 13:46, "Daniele Di Proietto" <diproiettod@vmware.com> wrote: >'be_cfg' may be NULL at that point. > >Found by testsuite. > >1051: ofproto-dpif - Flow IPFIX sanity check FAILED >(ofproto-dpif.at:6002) >1052: ofproto-dpif - Flow IPFIX sanity check - tunnel set FAILED >(ofproto-dpif.at:6041) > >0 0x00000000006ae830 in hmap_first_with_hash (hmap=0x110, >hash=2537071222) at ../lib/hmap.h:328 >1 0x00000000006af492 in smap_find__ (smap=0x110, key=0x762eda >"virtual_obs_id", key_len=14, hash=2537071222) at ../lib/smap.c:366 >2 0x00000000006aef19 in smap_get_node (smap=0x110, key=0x762eda >"virtual_obs_id") at ../lib/smap.c:198 >3 0x00000000006aeeaf in smap_get (smap=0x110, key=0x762eda >"virtual_obs_id") at ../lib/smap.c:189 >4 0x0000000000579972 in bridge_configure_ipfix (br=0x1266500) at >../vswitchd/bridge.c:1237 >5 0x00000000005782cb in bridge_reconfigure (ovs_cfg=0x12b9a00) at >../vswitchd/bridge.c:666 >6 0x000000000057e3e8 in bridge_run () at ../vswitchd/bridge.c:2972 >7 0x000000000058391f in main (argc=10, argv=0x7ffea2f6eb08) at >../vswitchd/ovs-vswitchd.c:112 > >Fixes: 337bebe91c94("ipfix: Export user specified virtual observation >ID") > >Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com> >--- > vswitchd/bridge.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > >diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c >index 19e9f2d..2a963fd 100644 >--- a/vswitchd/bridge.c >+++ b/vswitchd/bridge.c >@@ -1234,8 +1234,12 @@ bridge_configure_ipfix(struct bridge *br) > opts->enable_tunnel_sampling = smap_get_bool( > &fe_cfg->ipfix->other_config, > "enable-tunnel-sampling", true); >- virtual_obs_id = smap_get(&be_cfg->other_config, >- "virtual_obs_id"); >+ >+ virtual_obs_id = be_cfg >+ ? smap_get(&be_cfg->other_config, >+ "virtual_obs_id") >+ : NULL; >+ > opts->virtual_obs_id = (virtual_obs_id > ? xstrdup(virtual_obs_id) > : NULL); >-- >2.8.1 >
diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index 19e9f2d..2a963fd 100644 --- a/vswitchd/bridge.c +++ b/vswitchd/bridge.c @@ -1234,8 +1234,12 @@ bridge_configure_ipfix(struct bridge *br) opts->enable_tunnel_sampling = smap_get_bool( &fe_cfg->ipfix->other_config, "enable-tunnel-sampling", true); - virtual_obs_id = smap_get(&be_cfg->other_config, - "virtual_obs_id"); + + virtual_obs_id = be_cfg + ? smap_get(&be_cfg->other_config, + "virtual_obs_id") + : NULL; + opts->virtual_obs_id = (virtual_obs_id ? xstrdup(virtual_obs_id) : NULL);
'be_cfg' may be NULL at that point. Found by testsuite. 1051: ofproto-dpif - Flow IPFIX sanity check FAILED (ofproto-dpif.at:6002) 1052: ofproto-dpif - Flow IPFIX sanity check - tunnel set FAILED (ofproto-dpif.at:6041) 0 0x00000000006ae830 in hmap_first_with_hash (hmap=0x110, hash=2537071222) at ../lib/hmap.h:328 1 0x00000000006af492 in smap_find__ (smap=0x110, key=0x762eda "virtual_obs_id", key_len=14, hash=2537071222) at ../lib/smap.c:366 2 0x00000000006aef19 in smap_get_node (smap=0x110, key=0x762eda "virtual_obs_id") at ../lib/smap.c:198 3 0x00000000006aeeaf in smap_get (smap=0x110, key=0x762eda "virtual_obs_id") at ../lib/smap.c:189 4 0x0000000000579972 in bridge_configure_ipfix (br=0x1266500) at ../vswitchd/bridge.c:1237 5 0x00000000005782cb in bridge_reconfigure (ovs_cfg=0x12b9a00) at ../vswitchd/bridge.c:666 6 0x000000000057e3e8 in bridge_run () at ../vswitchd/bridge.c:2972 7 0x000000000058391f in main (argc=10, argv=0x7ffea2f6eb08) at ../vswitchd/ovs-vswitchd.c:112 Fixes: 337bebe91c94("ipfix: Export user specified virtual observation ID") Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com> --- vswitchd/bridge.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)