On Wed, Feb 20, 2019 at 04:53:45PM +0100, Lorenzo Bianconi wrote:
> Select a random IPAM mac_prefix if it has not been provided by the user.
> With this patch the admin can avoid to configure mac_prefix in order to
> avoid L2 address collisions if multiple OVN deployments share the same
> broadcast domain.
> Remove MAC_ADDR_PREFIX definitions/occurrences since now mac_prefix is
> always provided to ovn-northd
> 
> Tested-by: Miguel Duarte de Mora Barroso <[email protected]>
> Signed-off-by: Lorenzo Bianconi <[email protected]>

It's really not a good idea to modify an idl object in-place like this.
That's why they're all 'const'!  The IDL doesn't expect this kind of
thing and if it's not causing trouble now it could easily do so later:
> +    } else {
> +        eth_addr_random(&mac_prefix);
> +        memset(&mac_prefix.ea[3], 0, 3);
> +
> +        char *addr_prefix = xasprintf(ETH_ADDR_FMT, 
> ETH_ADDR_ARGS(mac_prefix));
> +        smap_add((struct smap *)&nb->options, "mac_prefix", addr_prefix);
> +        nbrec_nb_global_set_options(nb, &nb->options);
> +        free(addr_prefix);
>      }

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to