[ovs-dev] [PATCH] ofproto: Detect and handle errors in ofproto_port_add().

Justin Pettit jpettit at ovn.org
Wed Feb 3 04:05:36 UTC 2016


> On Feb 2, 2016, at 6:13 PM, Ben Pfaff <blp at ovn.org> wrote:
> 
> The update_port() function called in ofproto_port_add() can encounter
> errors that prevent a port from being added, but nothing was checking for
> the error and in fact update_port() didn't even pass the error along to
> its caller.  This commit fixes the problem.
> 
> The scenario that led me to examine this code can be triggered as follows
> from the sandbox, as long as you change --enable-dummy=override to
> --enable-dummy=system in ovs-sandbox:
> 
> ovs-vsctl add-br br0
> ovs-vsctl add-port br0 tun0 \
>    -- set interface tun0 type=stt options:remote_ip=1.2.3.4
> ovs-vsctl add-port br0 tun1 \
>    -- set interface tun1 type=stt options:remote_ip=1.2.3.4
> 
> The second add-port will fail due to the duplicate tunnel options, but
> ofproto_port_add() will not return the error.  Instead, it will report to
> the caller that it succeeded and tell it that it has ofp_port OFPP_NONE
> (65535), which is invalid and it obviously does not.  The result is that
> you get bizarre log messages like this:
> 
>    tunnel|WARN|tun1: attempting to add tunnel port with same config as port 'tun0' (::->1.2.3.4, key=0, dp port=7471, pkt mark=0)
>    ofproto|WARN|br0: could not add port tun1 (File exists)
>    bridge|INFO|bridge br0: added interface tun1 on port 65535
>    ofproto|WARN|br0: cannot configure bfd on nonexistent port 65535
>    ofproto|WARN|br0: cannot configure LLDP on nonexistent port 65535
>    ofproto|WARN|br0: cannot get STP status on nonexistent port 65535
>    ofproto|WARN|br0: cannot get RSTP status on nonexistent port 65535
>    ofproto|WARN|br0: cannot get STP stats on nonexistent port 65535
>    ofproto|WARN|br0: cannot get STP stats on nonexistent port 65535
> 
> VMware-BZ: #1598643
> Signed-off-by: Ben Pfaff <blp at ovn.org>

Thanks for tracking this down!

Acked-by: Justin Pettit <jpettit at ovn.org>

--Justin





More information about the dev mailing list