PingForAndroid
PingForAndroid copied to clipboard
C库采用SOCK_DGRAM方式构建icmp包,避开raw socket必须root权限的限制,实现ping功能
Results
4
PingForAndroid issues
Sort by
recently updated
recently updated
newest added
在将 thread_data 对象传给 recv_imcp 线程时,该对象的 buffer_len 变量没有设置初始值,导致在 259 行会崩溃,所以应该在创建 recv_imcp 线程前:thread_data.buffer_len = buffer_len; ---zsx
` client_fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_ICMP); if (client_fd == -1) { printf("socket error: %s!\n", strerror(errno)); return ret; } ` test on CentOS7, Ubutun 18.04, throw exception: [myk@sz Test]$ ./ping www.baidu.com...