Can't set don't frag socket option on ICMPV6 sockets

Hi,

I'm writing a test app to send ICMPv6 packets.
When I try to set the IPV6_DONTFRAG socket option, I get the error "operation not permitted" (EPERM).

I am able to set the IPV6_DONTFRAG socket option on UDP sockets running IPv6. I am also able to set the IP_DONTFRAG socket option on ICMPv4 sockets.

To summarize:
  • UDP - IPV4, don't fragment option can be set

  • UDP - IPV6, don't fragment option can be set

  • ICMP - IPV4, don't fragment option can be set

  • ICMP - IPV6, don't fragment option can't be set

Is there a reason/workaround to get this to work?

Another example, if the following command, I get that output
Code Block language
~ % ping6 -D www.google.com
ping6: IPV6_DONTFRAG: Operation not permitted


If I run
Code Block language
sudo ping6 -D -s 1600 www.google.com

the pings start to be sent, but according to a packet capture, they are fragmented. It seems like the socket option is not set/not followed?

Thanks





I haven’t looked this in detail but it certainly seems like a bug and I encourage you to file it as such. Please post your bug number, just for the record.

On the workaround front, what platform are developing for?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
I am developing for macOS and iOS. I've seen this occur on both iOS 14, and macOS 10.15, and macOS 11.

I've filed FB9091299

I've filed FB9091299

Thanks.

I am developing for macOS and iOS. I've seen this occur on both iOS
14, and macOS 10.15, and macOS 11.

On macOS you might be able to work around this using raw IP. This requires privilege escalation, which is a pain )-:

On iOS I can’t think of any workaround. Raw IP isn’t an option there because of the privilege escalation constraint.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
Can't set don't frag socket option on ICMPV6 sockets
 
 
Q