fixed a makefile problem

This commit is contained in:
root 2017-08-12 19:21:24 +08:00
parent 2fa2666479
commit 0266163b12
5 changed files with 7 additions and 11 deletions

View File

@ -59,7 +59,7 @@ typedef int i32_t;
const int max_data_len=1600; const int max_data_len=1600;
const int buf_len=max_data_len+200; const int buf_len=max_data_len+400;
const u32_t max_handshake_conn_num=10000; const u32_t max_handshake_conn_num=10000;
const u32_t max_ready_conn_num=1000; const u32_t max_ready_conn_num=1000;
const u32_t anti_replay_window_size=1000; const u32_t anti_replay_window_size=1000;

View File

@ -29,10 +29,6 @@ enum cipher_mode_t {cipher_none=0,cipher_aes128cbc,cipher_xor,cipher_end};
extern auth_mode_t auth_mode; extern auth_mode_t auth_mode;
extern cipher_mode_t cipher_mode; extern cipher_mode_t cipher_mode;
struct a
{
char * buf[buf_len];
};
extern unordered_map<int, const char *> auth_mode_tostring; extern unordered_map<int, const char *> auth_mode_tostring;
extern unordered_map<int, const char *> cipher_mode_tostring; extern unordered_map<int, const char *> cipher_mode_tostring;

View File

@ -2034,7 +2034,7 @@ int client_event_loop()
int recv_len; int recv_len;
struct sockaddr_in udp_new_addr_in; struct sockaddr_in udp_new_addr_in;
if ((recv_len = recvfrom(udp_fd, buf, buf_len, 0, if ((recv_len = recvfrom(udp_fd, buf, max_data_len, 0,
(struct sockaddr *) &udp_new_addr_in, &slen)) == -1) { (struct sockaddr *) &udp_new_addr_in, &slen)) == -1) {
mylog(log_error,"recv_from error,this shouldnt happen at client\n"); mylog(log_error,"recv_from error,this shouldnt happen at client\n");
myexit(1); myexit(1);
@ -2307,7 +2307,7 @@ int server_event_loop()
u32_t conv_id=conn_info.blob->conv_manager.find_conv_by_u64(fd); u32_t conv_id=conn_info.blob->conv_manager.find_conv_by_u64(fd);
int recv_len=recv(fd,buf,buf_len,0); int recv_len=recv(fd,buf,max_data_len,0);
mylog(log_trace,"received a packet from udp_fd,len:%d\n",recv_len); mylog(log_trace,"received a packet from udp_fd,len:%d\n",recv_len);

View File

@ -4,7 +4,7 @@ FLAGS2= -O3
all: all:
sudo killall udp2raw||true sudo killall udp2raw||true
sleep 0.2 sleep 0.2
gcc main.cpp -o udp2raw -static -ggdb -I. lib/aes.c lib/md5.c encrypt.cpp log.cpp network.cpp common.cpp -lrt -std=c++11 ${FLAGS} ${FLAGS2} g++ main.cpp -o udp2raw -static -ggdb -I. lib/aes.c lib/md5.c encrypt.cpp log.cpp network.cpp common.cpp -lrt -std=c++11 ${FLAGS} ${FLAGS2}
# ${ccmips} main.cpp -o udp2raw_ar71xx -lrt -I. lib/aes.c lib/md5.c encrypt.cpp log.cpp network.cpp common.cpp -std=c++11 ${FLAGS} ${FLAGS2} # ${ccmips} main.cpp -o udp2raw_ar71xx -lrt -I. lib/aes.c lib/md5.c encrypt.cpp log.cpp network.cpp common.cpp -std=c++11 ${FLAGS} ${FLAGS2}
fast: fast:
sudo killall udp2raw||true sudo killall udp2raw||true

View File

@ -391,7 +391,7 @@ int peek_raw(packet_info_t &peek_info)
char *ip_begin=peek_raw_buf+link_level_header_len; char *ip_begin=peek_raw_buf+link_level_header_len;
struct sockaddr saddr; struct sockaddr saddr;
socklen_t saddr_size; socklen_t saddr_size;
int recv_len = recvfrom(raw_recv_fd, peek_raw_buf,buf_len, MSG_PEEK ,&saddr , &saddr_size);//change buf_len to something smaller,we only need header here int recv_len = recvfrom(raw_recv_fd, peek_raw_buf,max_data_len, MSG_PEEK ,&saddr , &saddr_size);//change max_data_len to something smaller,we only need header here
iphdr * iph = (struct iphdr *) (ip_begin); iphdr * iph = (struct iphdr *) (ip_begin);
//mylog(log_info,"recv_len %d\n",recv_len); //mylog(log_info,"recv_len %d\n",recv_len);
if(recv_len<int(sizeof(iphdr))) if(recv_len<int(sizeof(iphdr)))
@ -450,7 +450,7 @@ int recv_raw_ip(raw_info_t &raw_info,char * &payload,int &payloadlen)
saddr_size = sizeof(saddr); saddr_size = sizeof(saddr);
int flag=0; int flag=0;
int recv_len = recvfrom(raw_recv_fd, recv_raw_ip_buf, buf_len, flag ,&saddr , &saddr_size); int recv_len = recvfrom(raw_recv_fd, recv_raw_ip_buf, max_data_len, flag ,&saddr , &saddr_size);
if(recv_len<0) if(recv_len<0)
{ {
@ -1183,7 +1183,7 @@ int recv_raw_tcp_deprecated(packet_info_t &info,char * &payload,int &payloadlen)
mylog(log_trace,"raw!\n"); mylog(log_trace,"raw!\n");
size = recvfrom(raw_recv_fd, buf, buf_len, 0 ,&saddr , &saddr_size); size = recvfrom(raw_recv_fd, buf, max_data_len, 0 ,&saddr , &saddr_size);
if(buf[12]!=8||buf[13]!=0) if(buf[12]!=8||buf[13]!=0)
{ {