Skip to content

Commit

Permalink
Add a new compiling arguement about exiting packet
Browse files Browse the repository at this point in the history
  • Loading branch information
shih-liang committed Feb 23, 2016
1 parent fd0da07 commit 493ecdf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 5 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ AS_IF([test "x$enable_notify" = "xno"],
[AC_DEFINE(NO_NOTIFY, [], [Define NO_NOTIFY to disable notification])],
[AC_CHECK_LIB([dl], [dlsym])])

AC_ARG_ENABLE([logout], [AC_HELP_STRING([ --disable-logout], [Don't logout when exiting])],
[], [enable_logout="yes"])
AS_IF([test "x$enable_logout" = "xno"],
[AC_DEFINE(NO_LOGOUT, [], [Define NO_LOGOUT to disable sending exiting packet])])

AS_IF([test -z "$enable_nls"], [enable_nls="yes"])

GETTEXT_PACKAGE="$PACKAGE_NAME"
Expand Down
2 changes: 1 addition & 1 deletion src/mystate.c
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ static int sendLogoffPacket()
memset(sendPacket+0x12, 0xa5, 42);
return pcap_sendpacket(hPcap, sendPacket, 60);
}
#ifdef NEED_LOGOUT
#ifndef NO_LOGOUT
fillStartPacket(); /* 锐捷的退出包与Start包类似,不过其实不这样也是没问题的 */
fillEtherAddr(0x888E0102);
memcpy(sendPacket+0x12, fillBuf, fillSize);
Expand Down
2 changes: 0 additions & 2 deletions src/mystate.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
#ifndef HUSTMOON_MYSTATE_H
#define HUSTMOON_MYSTATE_H

#define NEED_LOGOUT

#define ID_DISCONNECT 0 /* 断开状态 */
#define ID_START 1 /* 寻找服务器 */
#define ID_IDENTITY 2 /* 发送用户名 */
Expand Down

0 comments on commit 493ecdf

Please sign in to comment.