My OSX App it's ok and usually it sends same icmp packets with the sendto C function:
ssize_t ssizet = sendto(icmp_socket, &icmp, sizeof(icmp), 0, (struct sockaddr *)&sa, sizeof(sa)); if( ssizet==-1 ) {NSLog(@"sendto error %s %d", strerror(errno), errno);return;}Now i have activated the sandbox with this entitlements:
App Sandbox
com.apple.security.network.client
com.apple.security.network.server
The issue is that with sandbox activated the sendto function fails with a "not operation permitted" error.
In console I have found a lot of messages like this
24/03/16 20:44:05,340 sandboxd[115]: ([9013]) myPing(9013) deny network-outbound
so the problem is that the sandbox deny my sendto execution? But why? I have configurated the capabilities as i have show before.
What's my error? Could you say ne what's the issue?
Thanks
ICMP, like UDP, requires that you have both the
com.apple.security.network.clientandcom.apple.security.network.server entitlements. However, with those entitlements you should be able to send and receive pings just fine. I tried this out with a test project here in my office and it worked as expected. OTOH, if I remove either entitlement I get symptoms very much like the ones you described.
I recommend that you double check your entitlements. Specifically, make sure that your built binary has the right entitlements by running the following command:
$ codesign -d --entitlements :- /path/to/your/binaryShare and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"