-1

NDK programing for Android in C language: I need to create a ICMP socket with the following code:

socket(AF_INET, SOCK_DGRAM, IPPROTO_ICMP)

It fails. Does somebody know why?

Bartłomiej Semańczyk
  • 59,234
  • 49
  • 233
  • 358
Syosan
  • 21

1 Answers1

0

I have found the answer by myself:

echo 0 65535 > /proc/sys/net/ipv4/ping_group_range

Modify the config , the ICMP socket will create successed!

NapkinHD
  • 166
  • 8
  • 23
Syosan
  • 21