nagyistoce / mytunet

Automatically exported from code.google.com/p/mytunet
0 stars 0 forks source link

终端版的MyTunet有巨大Bug… #9

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
连接网络后按下Ctrl+C,程序退出,但是802.1x依然还连接着。 

What is the expected output? What do you see instead?
官方Tunet的行为比较正常,Ctrl+C后网络彻底中断,但是MyTunet��
�退出后还能连接上校园网。

What version of the product are you using? On what operating system?
Check out出来的源代码,修改了网卡配置文件。
Mac OS X 10.5

Please provide any additional information below.
将源代码进行如下修改,问题基本解决:
增加SIGINT信号捕获:
#include <signal.h>
static void sigint_receiver(int signum) {
    printf("Got terminate signal!\n");
    if(!get_in_main_loop) {
        printf("Loop in\n");
        tunet_stop();
        if(g_UserConfig.bUseDot1x) dot1x_stop();

    }
    mytunetsvc_cleanup();

    exit(0);
}
main函数中增加:
struct sigaction act;
memset(&act, 0, sizeof(act));
act.sa_handler = sigint_receiver;
sigaction(SIGINT, &act, NULL);

见附件中的截图。

Original issue reported on code.google.com by mingocha...@gmail.com on 8 Apr 2009 at 4:43

Attachments:

GoogleCodeExporter commented 9 years ago
忘了说,为了探测程序是否进入了主循环,增加了主循环探��
�变量int get_in_main_loop。
sigint_receiver(int signum)函数放在main.c中。

Original comment by mingocha...@gmail.com on 8 Apr 2009 at 4:45

GoogleCodeExporter commented 9 years ago

Original comment by h...@linshuang.info on 10 Apr 2009 at 9:52

GoogleCodeExporter commented 9 years ago
修改了一下,现在退出的时候会注销了,用的mytunetsvc_set_stop_
flag()

Original comment by Henry.Hu...@gmail.com on 14 Apr 2009 at 10:16