2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 14:25:26 +00:00

netdev-dummy: Close pcap files when dummy device is closed.

Fixes a fd leak.

Reported-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
This commit is contained in:
Ben Pfaff
2017-08-08 16:37:15 -07:00
parent 0ac01021a9
commit 360990eb1d

View File

@@ -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;