Author Topic: Apple drops ipv4 app approvals  (Read 2911 times)

phoenix

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 3
  • Posts: 49
    • View Profile

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Apple drops ipv4 app approvals
« Reply #1 on: May 05, 2016, 05:04:26 PM »
TNet uses IPAddress, which supports both ipv4 and ipv6.

phoenix

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 3
  • Posts: 49
    • View Profile
Re: Apple drops ipv4 app approvals
« Reply #2 on: May 16, 2016, 01:29:23 AM »
as I am going through this article
http://blogs.unity3d.com/2016/05/10/unity-and-ipv6-support/

I noticed that the multicast  ip address is hard coded
What should we change this to for ipv6?

// Cached broadcast end-point
static IPAddress multicastIP = IPAddress.Parse("224.168.100.17");

also
IPv6 addresses are 128-bit IP address written in hexadecimal and separated by colons. An example IPv6 address could be written like this: 3ffe:1900:4545:3:200:f8ff:fe21:67cf (see "What does an IPv6 address look like?")

this function seems to parse on the : for a port, but this seems like it might no longer work for ipv6
static public IPEndPoint ResolveEndPoint (string address)

I feel like maybe I dont understand what I need to change ? if anything?

Does this need to be changed?

"Look for the use of the IPAddress.Any and IPAddress.Loopback fields. These fields work with IPv4 addresses, not IPv6 addresses. Use the IPAddress.IPv6Any and IPAddress.IPv6Loopback fields as well to ensure IPv6 support."

And then will this then be called properly in the TNTools functions?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Apple drops ipv4 app approvals
« Reply #3 on: May 18, 2016, 05:24:21 AM »
IPv6 is for external addressing. Multicasting is internal (LAN). It shouldn't need to be changed.

ResolveEndPoint simply calls ResolveAddress, which handles IPv6. It only considers the address:port notation if the address.Split(":") has 2 parts.

I'd say change IsValidAddress to include IPAddress.IPv6 versions, but that's about it:
  1.         static public bool IsValidAddress (IPAddress address)
  2.         {
  3.                 if (address.AddressFamily != AddressFamily.InterNetwork) return false;
  4.                 if (address.Equals(IPAddress.Loopback) || address.Equals(IPAddress.IPv6Loopback)) return false;
  5.                 if (address.Equals(IPAddress.None) || address.Equals(IPAddress.IPv6None)) return false;
  6.                 if (address.Equals(IPAddress.Any) || address.Equals(IPAddress.IPv6Any)) return false;
  7.                 if (address.ToString().StartsWith("169.")) return false;
  8.                 return true;
  9.         }
That said, even that shouldn't be necessary. I don't see anyone typing "0:0:0:0:0:0:0:1" instead of "localhost" or "127.0.0.1", for example.

P.S. The only relevant thing I can think of is perhaps change the
  1. mListener = new TcpListener(IPAddress.Any, port);
to
  1. mListener = new TcpListener(IPAddress.IPv6Any, port);
...as according to the docs, IPv6Any accepts IPv4 as well by default.
« Last Edit: May 18, 2016, 05:30:11 AM by ArenMook »