记录贴
sockfd = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP);
if (sockfd < 0)
{
printf("ip:%s,socket error\n",ips);
return ERROR;
}
经过查资料发现是需要在root权限下运行
2022-08-04 14:48:52
sockfd = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP);
if (sockfd < 0)
{
printf("ip:%s,socket error\n",ips);
return ERROR;
}
经过查资料发现是需要在root权限下运行