Bug 1597

Summary: EmuNetDevice::StopDevice() does not return
Product: ns-3 Reporter: konstantin.miller
Component: fd-net-deviceAssignee: alina <aquereilhac>
Status: RESOLVED FIXED    
Severity: normal CC: konstantin.miller, ns-bugs, tomh
Priority: P5    
Version: ns-3.14   
Hardware: PC   
OS: Linux   

Description konstantin.miller 2013-02-25 01:53:22 UTC
This bug is related to bug 903, which is for the TAP device and is supposed to be fixed.

Upon calling Simulator::Destroy(), EmuNetDevice::StopDevice() is called. The latter does not return since it waits for EmuNetDevice::ReadThread() to terminate. ReadThread, however, is blocked by a call to recvfrom().

I filed the bug for the version 3.14 but it seems like this part of the code didn't change in the last version.
Comment 1 Tom Henderson 2014-10-06 16:37:26 UTC
need to confirm that this bug still exists with FdNetDevice
Comment 2 Tom Henderson 2017-02-07 10:26:54 UTC
Closing this bug as resolved, fixed (by refactoring of emu to fd-net-device)

This is the old behavior referred to in the bug report:
http://code.nsnam.org/ns-3.13/file/806692404e47/src/emu/model/emu-net-device.cc#l617

which resulted in a a blocking call to pthread_join().

Currently, EmuNetDevice was replaced by FdNetDevice, which has this different code for StopDevice:
http://code.nsnam.org/ns-3.26/file/af21cf79d193/src/fd-net-device/model/fd-net-device.cc#l271