diff --git a/Makefile b/Makefile index d851820..a064343 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,7 @@ IS_DEBUG := DEBUG #如果是, 就取GUI,否则就是空 IS_GUI := -VERSION := 0.0.3.3 +VERSION := 0.0.3.4 CONFIG := ./drcomrc ifneq "$(IS_GUI)" "" RES := resource diff --git a/main_cli.c b/main_cli.c index 6d0b6f6..c60ad16 100644 --- a/main_cli.c +++ b/main_cli.c @@ -99,7 +99,7 @@ int main(int argc, char **argv) #endif if (islogoff) { - eaplogoff(); + try_smart_logoff(); return 0; } diff --git a/wrap_eapol.c b/wrap_eapol.c index da09e8f..b64c71c 100644 --- a/wrap_eapol.c +++ b/wrap_eapol.c @@ -10,7 +10,7 @@ extern int try_smart_login(char const *uname, char const *pwd) if (0 >= getall_ifs(ifs, &ifs_max)) return -3; int i; for (i = 0; i < ifs_max; ++i) { - _M("%d. try interface (%s) to login\n", i, + _M("%d. try interface (%s) to login...\n", i, #ifdef LINUX ifs[i].name #elif defined(WINDOWS) @@ -30,3 +30,23 @@ extern int try_smart_login(char const *uname, char const *pwd) } return ret; } + +extern void try_smart_logoff(void) +{ + iflist_t ifs[IFS_MAX]; + int ifs_max = IFS_MAX; + int ret = -3; + if (0 >= getall_ifs(ifs, &ifs_max)) return; + int i; + for (i = 0; i < ifs_max; ++i) { + _M("%d. try interface (%s) to logoff...\n", i, +#ifdef LINUX + ifs[i].name +#elif defined(WINDOWS) + ifs[i].desc +#endif + ); + setifname(ifs[i].name); + eaplogoff(); + } +} diff --git a/wrap_eapol.h b/wrap_eapol.h index afe75fe..ee8368c 100644 --- a/wrap_eapol.h +++ b/wrap_eapol.h @@ -8,5 +8,9 @@ * 自动选择网卡登录 */ extern int try_smart_login(char const *uname, char const *pwd); +/* + * 自动选择网卡离线 + */ +extern void try_smart_logoff(void); #endif