android: Mitigate race condition on reauthentication
authorTobias Brunner <tobias@strongswan.org>
Fri, 1 Mar 2013 16:01:21 +0000 (17:01 +0100)
committerTobias Brunner <tobias@strongswan.org>
Fri, 1 Mar 2013 16:06:01 +0000 (17:06 +0100)
commite88b529a30a4b8d31c7754645bda1f1edb1b4e45
tree1c14c7f9807ecdde92176e9ed76bebb209a37cdf
parent4c969f790692d9f93105cef7abe066bc4222f09b
android: Mitigate race condition on reauthentication

If the TUN device gets recreated while another thread in handle_plain()
has not yet called select(2) but already stored the file descriptor of the
old TUN device in its FD set, select() will fail with EBADF.

Fixes #301.
src/frontends/android/jni/libandroidbridge/backend/android_service.c