From 84855a393cf1630d5e142f6949301b441857cd6b Mon Sep 17 00:00:00 2001 From: wangyu Date: Sun, 30 Jul 2017 17:07:17 +0800 Subject: [PATCH] fixed core dumped from last commit --- common.h | 2 +- main.cpp | 2 ++ makefile | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/common.h b/common.h index 01a6fd5..e7fa40a 100644 --- a/common.h +++ b/common.h @@ -81,7 +81,7 @@ const uint32_t server_conn_timeout=conv_timeout+10000;//for test -enum raw_mode_t{mode_faketcp=1,mode_udp,mode_icmp,mode_end}; +enum raw_mode_t{mode_faketcp=0,mode_udp,mode_icmp,mode_end}; extern raw_mode_t raw_mode; enum program_mode_t {unset_mode=0,client_mode,server_mode}; extern program_mode_t program_mode; diff --git a/main.cpp b/main.cpp index ea56cda..5bd4c8b 100755 --- a/main.cpp +++ b/main.cpp @@ -2700,6 +2700,8 @@ void process_arg(int argc, char *argv[]) { if(strcmp(optarg,raw_mode_tostring[i])==0) { + printf("%d i\n",i); + printf("%s",raw_mode_tostring[i]); raw_mode=(raw_mode_t)i; break; } diff --git a/makefile b/makefile index 468bbef..7641bfc 100755 --- a/makefile +++ b/makefile @@ -1,5 +1,5 @@ ccmips=mips-openwrt-linux-g++ -FLAGS=-Wall -Wextra -Wno-unused-variable -Wno-unused-parameter -O3 +FLAGS=-Wall -Wextra -Wno-unused-variable -Wno-unused-parameter all: sudo killall udp2raw||true sleep 0.2