> Buffered packets are always packets created by 'dp_packet_clone_data()'
> i.e. they are malloced. It's not enough to free the packet data,
> dp_packet structure must be freed too. 'dp_packet_delete()' will take
> care of that.
> 
> CC: Lorenzo Bianconi <[email protected]>
> Fixes: d7abfe39cfd2 ("OVN: add buffering support for ip packets")
> Signed-off-by: Ilya Maximets <[email protected]>
> ---
>  ovn/controller/pinctrl.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/ovn/controller/pinctrl.c b/ovn/controller/pinctrl.c
> index 21454ab47..56539a891 100644
> --- a/ovn/controller/pinctrl.c
> +++ b/ovn/controller/pinctrl.c
> @@ -229,7 +229,7 @@ destroy_buffered_packets(struct buffered_packets *bp)
>  
>      while (bp->head != bp->tail) {
>          bi = &bp->data[bp->head];
> -        dp_packet_uninit(bi->p);
> +        dp_packet_delete(bi->p);
>          ofpbuf_uninit(&bi->ofpacts);
>  
>          bp->head = (bp->head + 1) % BUFFER_QUEUE_DEPTH;
> @@ -267,7 +267,7 @@ buffered_push_packet(struct buffered_packets *bp,
>  
>      if (next == bp->head) {
>          bi = &bp->data[bp->head];
> -        dp_packet_uninit(bi->p);
> +        dp_packet_delete(bi->p);
>          ofpbuf_uninit(&bi->ofpacts);
>          bp->head = (bp->head + 1) % BUFFER_QUEUE_DEPTH;
>      }
> @@ -296,7 +296,7 @@ buffered_send_packets(struct buffered_packets *bp, struct 
> eth_addr *addr)
>          queue_msg(ofputil_encode_packet_out(&po, proto));
>  
>          ofpbuf_uninit(&bi->ofpacts);
> -        dp_packet_uninit(bi->p);
> +        dp_packet_delete(bi->p);
>  
>          bp->head = (bp->head + 1) % BUFFER_QUEUE_DEPTH;
>      }
> -- 
> 2.17.1
> 

Thanks for fixing it

Acked-by: Lorenzo Bianconi <[email protected]>
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to