Closed bao3 closed 6 years ago
访问服务器以外的地址需要自行编译无限制版服务端。
@phc217 感谢指点。我在原代码里看到如下片断:
#ifndef NOLIMIT
- if(client_or_server==server_mode)
- {
- char * tmp_data=out_arr[i];
- int tmp_len=out_len[i];
- if(tmp_len>=20)
- {
- u32_t dest_ip=htonl(read_u32(tmp_data+16));
- //printf("%s\n",my_ntoa(dest_ip));
- if( ( ntohl(sub_net_uint32)&0xFFFFFF00 ) != ( ntohl (dest_ip) &0xFFFFFF00) )
- {
- string sub=my_ntoa(dest_ip);
- string dst=my_ntoa( htonl( ntohl (sub_net_uint32) &0xFFFFFF00) );
- mylog(log_warn,"[restriction]packet's dest ip [%s] not in subnet [%s],dropped\n", sub.c_str(), dst.c_str());
- continue;
- }
- }
- }
-#endif
是不是意味着我只要在这个文件的开头就写上 #define NOLIMIT
?就可以了?
@phc217 Hi,上面的问题不用回答了,因为我在 makefile
里找到答案了。
# targets without restrictions:
nolimit:
make OPT=-DNOLIMIT
nolimit_all:
make OPT=-DNOLIMIT
nolimit_cross:
make cross OPT=-DNOLIMIT
nolimit_cross2:
make cross2 OPT=-DNOLIMIT
nolimit_cross3:
make cross3 OPT=-DNOLIMIT
nolimit_release:
make release OPT=-DNOLIMIT
@bao3 请问怎么编译无限制的版本?
For English speaking user: https://github.com/wangyu-/UDPspeeder/wiki/Issue-Guide
中文用户请看: https://github.com/wangyu-/UDPspeeder/wiki/发Issue前请看 (否则Issue可能被忽略,或被直接关掉)