I'm debugging an issue on IPv4 networks and am trying to force a nw_connection to use IPv4 as opposed to IPv6, which it's defaulting to on my network.
The documentation for IP Options is extremely sparse, so I had to dive into the nwcat example to see how one is supposed to use nw_ip_options_set_version.
Here's what I've got:
This matches what is done in the nwcat example at main.c:359
The problem is, despite explicitly setting the IP version ip IPv4, it's still using IPv6 (the website in question supports both). I can see this by looking at the effective remote endpoint.
This issue happens both in my iOS app as well as the nwcat example itself, which I verified with Wireshark
Is this a SDK bug? Or is just bad luck that the documentation is lacking and the example is incorrect?
The documentation for IP Options is extremely sparse, so I had to dive into the nwcat example to see how one is supposed to use nw_ip_options_set_version.
Here's what I've got:
Code Block c nw_parameters_t parameters = nw_parameters_create_secure_tcp(configure_tls, configure_tcp); nw_protocol_stack_t protocol_stack = nw_parameters_copy_default_protocol_stack(parameters); nw_protocol_options_t ip_options = nw_protocol_stack_copy_internet_protocol(protocol_stack); nw_ip_options_set_version(ip_options, nw_ip_version_4);
This matches what is done in the nwcat example at main.c:359
The problem is, despite explicitly setting the IP version ip IPv4, it's still using IPv6 (the website in question supports both). I can see this by looking at the effective remote endpoint.
This issue happens both in my iOS app as well as the nwcat example itself, which I verified with Wireshark
Is this a SDK bug? Or is just bad luck that the documentation is lacking and the example is incorrect?