Skip to content

Commit

Permalink
[ALL] 修改不爽的警告
Browse files Browse the repository at this point in the history
  • Loading branch information
leetking authored and leetking committed Sep 15, 2016
1 parent 23b906c commit 1d2618b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#CC := gcc
CC := gcc
#针对路由器的,一般的cpu架构都是mips msb吧:),用于交叉编译
#MIPS MSB
#CC := mips-openwrt-linux-gcc
#MIPS LSB
CC := mipsel-openwrt-linux-gcc
#CC := mipsel-openwrt-linux-gcc

RM := rm -rf
CP := cp -r
Expand Down
3 changes: 2 additions & 1 deletion common.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
* 一些通用的代码
*/
#include <string.h>
#include "common.h"
#include <stdlib.h>
#include <ctype.h>
#include "common.h"

#ifdef LINUX
# include <unistd.h>
Expand Down
4 changes: 3 additions & 1 deletion eapol.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ static char _uname[UNAME_LEN];
static char _pwd[PWD_LEN];
static int pwdlen;

static int mac_equal(uchar *mac1, uchar *mac2);
static int eap_keep_alive(int skfd, struct sockaddr const *skaddr);
static int eap_md5_clg(int skfd, struct sockaddr const *skaddr);
static int eap_res_identity(int skfd, struct sockaddr const *skaddr);
Expand Down Expand Up @@ -112,6 +111,7 @@ static int eapol_init(int *skfd, struct sockaddr *skaddr)
*/
static int filte_req_identity(int skfd, struct sockaddr const *skaddr)
{
(void)skaddr;
int stime = time((time_t*)NULL);
for (; difftime(time((time_t*)NULL), stime) <= TIMEOUT;) {
/* TODO 看下能不能只接受某类包,包过滤 */
Expand All @@ -135,6 +135,7 @@ static int filte_req_identity(int skfd, struct sockaddr const *skaddr)
*/
static int filte_req_md5clg(int skfd, struct sockaddr const *skaddr)
{
(void)skaddr;
int stime = time((time_t*)NULL);
for (; difftime(time((time_t*)NULL), stime) <= TIMEOUT;) {
recvfrom(skfd, recvbuff, BUFF_LEN, 0, NULL, NULL);
Expand Down Expand Up @@ -174,6 +175,7 @@ static int filte_req_md5clg(int skfd, struct sockaddr const *skaddr)
*/
static int filte_success(int skfd, struct sockaddr const *skaddr)
{
(void)skaddr;
int stime = time((time_t*)NULL);
for (; difftime(time((time_t*)NULL), stime) <= TIMEOUT;) {
recvfrom(skfd, recvbuff, BUFF_LEN, 0, NULL, NULL);
Expand Down
9 changes: 7 additions & 2 deletions main_cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ int main(int argc, char **argv)
char pwd[PWD_LEN];

char islogoff = 0;
char iskpalv = 0;
#ifdef WINDOWS
char iskpalv = 0;
char kpalv_if[IFNAMSIZ];
#endif

Expand All @@ -33,7 +33,9 @@ int main(int argc, char **argv)
} else if (0 == strcmp("-h", argv[1])) {
help(argc, argv);
return 0;
} else if (0 == strcmp("-k", argv[1])) {
}
#ifdef WINDOWS
if (0 == strcmp("-k", argv[1])) {
/*
* -k选项让这个程序作为心跳程序运行。
* -k ifname
Expand All @@ -47,11 +49,13 @@ int main(int argc, char **argv)
_D("kpalv_if: %s\n", kpalv_if);
iskpalv = 1;
}
#endif
}
if (0 != getconf(uname, pwd)) {
fprintf(stderr, "Not configure.\n");
return 1;
}

#ifdef WINDOWS
/* windows下作为心跳进程运行的代码 */
if (iskpalv) {
Expand All @@ -66,6 +70,7 @@ int main(int argc, char **argv)
return 1;
}
#endif

if (islogoff) {
eaplogoff();
return 0;
Expand Down

0 comments on commit 1d2618b

Please sign in to comment.