On Fri, Mar 23, 2012 at 6:04 PM, Ansis Atteka <aatt...@nicira.com> wrote:

> This patch removes port from datapath before vswitchd sets ofport column
> to -1 (e.g. if user-space attempted to create a duplicate tunnel then
> kernel would reject config changes and leave the old tunnel with its old
> config. Hence the user-space have to remove it)
>
> Signed-off-by: Ansis Atteka <aatt...@nicira.com>
> ---
>  vswitchd/bridge.c |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
> index 6449333..e1a663d 100644
> --- a/vswitchd/bridge.c
> +++ b/vswitchd/bridge.c
> @@ -1199,6 +1199,11 @@ bridge_add_ofproto_ports(struct bridge *br)
>                     /* We already reported a related error, don't bother
>                      * duplicating it. */
>                 }
> +                if (!ofproto_port_query_by_name(br->ofproto, port->name,
> +
> &ofproto_port)) {
> +                    ofproto_port_del(br->ofproto, ofproto_port.ofp_port);
> +                    ofproto_port_destroy(&ofproto_port);
> +                }
>
RFC: Not sure if it would have been more correctly to use
dpif_linux_port_del directly here? Perhaps someone can
clarify?

>                 iface_clear_db_record(iface->cfg);
>                 iface_destroy(iface);
>             }
> --
> 1.7.9
>
>
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to