Hi,
a device running alfred maybe has to remove the underlying device (e.g. wlan device has to be reconfigured). This currently makes it necessary to restart alfred to get the device sending data again. An unwanted side effect of this procedure is the removal of all data currently stored in alfred.
Instead alfred should detect such problems and try to recover by reopening the device after sleeping a while. The sleeping is automatically done by select.
I've tested the changes only using macvtap:
Terminal 1:
$ ip link del dev macvlan0 $ ip link add link eth0 name macvlan0 type macvlan $ ip link set macvlan0 address 1a:46:0b:ca:bc:7b up $ ./alfred -b none -i macvlan0
Terminal 2 (after letting alfred run for a while)
$ ip link del dev macvlan0 $ ip link add link eth0 name macvlan0 type macvlan $ ip link set macvlan0 address 1a:46:0b:ca:bc:7b up
Kind regards, Sven
alfred.h | 4 ++-- netsock.c | 16 ++++++++-------- recv.c | 3 +++ send.c | 27 +++++++++++++++++++++------ server.c | 36 +++++++++++++++++++++++++++--------- 5 files changed, 61 insertions(+), 25 deletions(-)