[ovs-dev] [PATCH] bridge: Avoid memory leak from RSPAN mirrors in bridge_destroy().

Justin Pettit jpettit at nicira.com
Wed Apr 20 17:40:30 UTC 2011


Looks good to me.

--Justin


On Apr 20, 2011, at 10:32 AM, Ben Pfaff wrote:

> Mirrors that output to ports will be destroyed when their output ports are
> destroyed, but mirrors that output to VLANs ("RSPAN" mirrors) don't get
> automatically destroyed like this and we need to take care of them in a
> separate loop.
> ---
> vswitchd/bridge.c |    4 ++++
> 1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
> index f5918be..2b8b248 100644
> --- a/vswitchd/bridge.c
> +++ b/vswitchd/bridge.c
> @@ -1696,10 +1696,14 @@ bridge_destroy(struct bridge *br)
>     if (br) {
>         struct port *port, *next;
>         int error;
> +        int i;
> 
>         HMAP_FOR_EACH_SAFE (port, next, hmap_node, &br->ports) {
>             port_destroy(port);
>         }
> +        for (i = 0; i < MAX_MIRRORS; i++) {
> +            mirror_destroy(br->mirrors[i]);
> +        }
>         list_remove(&br->node);
>         ofproto_destroy(br->ofproto);
>         error = dpif_delete(br->dpif);
> -- 
> 1.7.1
> 
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev




More information about the dev mailing list