On Tue, Jun 28, 2016 at 10:02:22PM -0700, William Tu wrote:
> Signed-off-by: William Tu <u9012...@gmail.com>
> ---
>  vswitchd/bridge.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
> index 8ebfc66..7244e11 100644
> --- a/vswitchd/bridge.c
> +++ b/vswitchd/bridge.c
> @@ -1999,7 +1999,7 @@ find_local_hw_addr(const struct bridge *br, struct 
> eth_addr *ea,
>  
>              /* The local port doesn't count (since we're trying to choose its
>               * MAC address anyway). */
> -            if (iface->ofp_port == OFPP_LOCAL) {
> +            if (iface && iface->ofp_port == OFPP_LOCAL) {
>                  continue;
>              }

A port is guaranteed to have at least one interface, so 'iface' can't be
null here.  Even if it could, this patch wouldn't help because a few
lines down there's an unconditional dereference.

I'd happily add an assertion to document this, e.g.:
        http://openvswitch.org/pipermail/dev/2016-July/074352.html
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to