Thanks for the review, I applied this to master, branch-2.8, and
branch-2.7.

On Tue, Aug 08, 2017 at 11:38:35PM +0000, Alin Serdean wrote:
> Acked-by: Alin Gabriel Serdean <aserd...@cloudbasesolutions.com>
> 
> 
> > -----Original Message-----
> > From: Ben Pfaff [mailto:b...@ovn.org]
> > Sent: Wednesday, August 9, 2017 2:37 AM
> > To: d...@openvswitch.org
> > Cc: Ben Pfaff <b...@ovn.org>; Alin Serdean
> > <aserd...@cloudbasesolutions.com>
> > Subject: [PATCH] netdev-dummy: Close pcap files when dummy device is
> > closed.
> > 
> > Fixes a fd leak.
> > 
> > Reported-by: Alin Gabriel Serdean <aserd...@cloudbasesolutions.com>
> > Signed-off-by: Ben Pfaff <b...@ovn.org>
> > ---
> >  lib/netdev-dummy.c | 6 ++++++
> >  1 file changed, 6 insertions(+)
> > 
> > diff --git a/lib/netdev-dummy.c b/lib/netdev-dummy.c index
> > 752f15765bb2..62ddd0c67834 100644
> > --- a/lib/netdev-dummy.c
> > +++ b/lib/netdev-dummy.c
> > @@ -708,6 +708,12 @@ netdev_dummy_destruct(struct netdev *netdev_)
> >      ovs_mutex_unlock(&dummy_list_mutex);
> > 
> >      ovs_mutex_lock(&netdev->mutex);
> > +    if (netdev->rxq_pcap) {
> > +        fclose(netdev->rxq_pcap);
> > +    }
> > +    if (netdev->tx_pcap && netdev->tx_pcap != netdev->rxq_pcap) {
> > +        fclose(netdev->tx_pcap);
> > +    }
> >      dummy_packet_conn_close(&netdev->conn);
> >      netdev->conn.type = NONE;
> > 
> > --
> > 2.10.2
> 
_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to