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:
@@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user