Android 4.4 is now 9 years old and the main user of this API (OpenVPN
for Android) does not support this OS anymore. This workaround
is now safe to remove.
Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <
20220504111802.
1050648-1-arne@rfc2549.org>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg24276.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
{
return ANDROID_KEEP_OLD_TUN;
}
- else if (!strcmp("OPEN_AFTER_CLOSE", up.password))
- {
- return ANDROID_OPEN_AFTER_CLOSE;
- }
else if (!strcmp("OPEN_BEFORE_CLOSE", up.password))
{
return ANDROID_OPEN_BEFORE_CLOSE;
}
ASSERT(0);
- return ANDROID_OPEN_AFTER_CLOSE;
+ return ANDROID_OPEN_BEFORE_CLOSE;
}
bool management_android_control(struct management *man, const char *command, const char *msg);
#define ANDROID_KEEP_OLD_TUN 1
-#define ANDROID_OPEN_AFTER_CLOSE 2
-#define ANDROID_OPEN_BEFORE_CLOSE 3
+#define ANDROID_OPEN_BEFORE_CLOSE 2
int managment_android_persisttun_action(struct management *man);
#endif
int android_method = managment_android_persisttun_action(management);
- /* Android 4.4 workaround */
- if (oldtunfd >=0 && android_method == ANDROID_OPEN_AFTER_CLOSE)
- {
- close(oldtunfd);
- management_sleep(2);
- }
-
if (oldtunfd >=0 && android_method == ANDROID_KEEP_OLD_TUN)
{
/* keep the old fd */
management->connection.lastfdreceived = -1;
}
- if (oldtunfd>=0 && android_method == ANDROID_OPEN_BEFORE_CLOSE)
+ if (oldtunfd >= 0 && android_method == ANDROID_OPEN_BEFORE_CLOSE)
{
close(oldtunfd);
}