Search Unity

GetAllNetworkInterfaces stopped working on Mavericks 10.9

Discussion in 'Editor & General Support' started by Checco-Esimple, Oct 16, 2013.

  1. Checco-Esimple

    Checco-Esimple

    Joined:
    Feb 14, 2008
    Posts:
    82
    Hi Guys,

    I know that 10.9 is not out yes, but it will be for sure next week and I'm scared about it because some of our solutions stopped working because the lack of support of "GetAllNetworkInterfaces" which gives an internal error on all the compiled solutions running on mavericks.

    It seems that System.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces ()

    is not anymore available under 10.9.

    Do you have any suggestion on it?
     
  2. stiltskin

    stiltskin

    Joined:
    Feb 27, 2010
    Posts:
    95
    I have the same error. Any news from Unity on a fix for this?
     
  3. DevTony

    DevTony

    Joined:
    Oct 3, 2013
    Posts:
    4
    In Terminal enter: ifconfig -a
    How many adapters/interfaces along the left side do you count? (ex: en0, en1)
    If that number is 8 or higher, this is almost certainly the issue, or a flavor of it: https://wrench.mono-project.com/Wrench/GetRevisionLog.aspx?id=8248

    In my case, 10.9 happened to add a Thunderbolt Bridge to my adapter list which pushed me to 8 entries, I watched the jump and my script promptly started failing. A bit of searching and I see this issue going all the way back to 10.6 so I'm thinking 10.9 might just be a coincidence.

    I've filed a bug report w/ Unity, but until they/Mono get this properly fixed, my next step was going to be attempting (via Terminal) to remove an unused adapter from my list (rumor has it the Network settings UI doesn't 'really' remove them, just hides them) in an attempt to push my count below 8, this thread on the topic is where I plan to start: https://discussions.apple.com/thread/2328785 <- using networksetup w/ Terminal
     
  4. SteelGander

    SteelGander

    Joined:
    Feb 14, 2013
    Posts:
    2
    I was having this issue as well but discovered a workaround that has unblocked me at least for development purposes.

    You're suffering from a know bug with Unity/C# which you should go complain about and vote to have fixed here :

    Basically, on a Mac OSX device the call to "NetworkInterface.GetAllNetworkInterfaces() " craps out if you have any network devices that have names over 6 characters long. As part of your standard Mavericks install, OSX includes an interface called "bridge0" which is associated with the "Thunderbolt Bridge" port, which is some special new plug for quickly transferring files between macs.

    My workaround was to simply delete my "bridge0" interface. I did this by going to : [System Preferences]->[Network], you should see a listing for "Thunderbolt Bridge" in your device list... delete it by pressing the [-] button. I also had to finish the job, by pressing the [gear] button at the bottom of the list and selecting [Manage Virtual Interfaces], bridge0 appears here, I killed it using the [-] button.

    This got my code running (listing below). As a side note, the operating system will detect the Thunderbolt port and re-install it anytime you open your Network preferences pane, so if this whole thing makes you anxious, don't worry, it doesn't seem to cause permanent damage.

    Code (csharp):
    1.  
    2. using System.Net.NetworkInformation;
    3.  
    4.                     NetworkInterface[] adapters = NetworkInterface.GetAllNetworkInterfaces();
    5.             foreach (NetworkInterface adapter in adapters)
    6.             {
    7.                 IPInterfaceProperties properties = adapter.GetIPProperties();
    8.                 log.Debug(adapter.Description);
    9.                 log.Debug("  DNS suffix .............................. : "+properties.DnsSuffix);
    10.                 log.Debug("  DNS enabled ............................. : "+properties.IsDnsEnabled);
    11.                 log.Debug("  Dynamically configured DNS .............. : "+properties.IsDynamicDnsEnabled);
    12.             }
    13.             log.Debug("\n");
     
    Last edited: Mar 25, 2014
  5. pushxtonotdie

    pushxtonotdie

    Joined:
    Oct 21, 2010
    Posts:
    111
    Some extra information: Creating a new network location will stop mavericks from automatically adding the ethernet bridge when you open network prefs. Also the Thunderbolt Ethernet Bridge is a way to connect two macs together with a Thunderbolt cable, and has nothing to do with standard ethernet connectivity. This is *not* a Mavericks-only issue, but is worse in Mavericks because they added the automatic addition of the bridge for the automatic location.

    Lastly, this is fixed according to the issue tracker and should be out in (hopefully) the next release.
     
  6. Merrik44

    Merrik44

    Joined:
    May 8, 2013
    Posts:
    38
    Thanks for figuring this out!
    Is there any indication of when the next release will be?
    This is a pretty serious issue!

    Also, does anyone have an idea of how I could check if this is happening on some windows PC's?
    Perhaps by inspecting the interfaces listed by 'ipconfig /all'

    Thanks!
     
    Last edited: May 26, 2014
  7. TomLeisure

    TomLeisure

    Joined:
    Apr 5, 2017
    Posts:
    1
    I am resuming this thread to understand the current state for this mono .net issue on UNITY_STANDALONE_OSX builds.

    Just a quick note that: MacOS users might find useful, on MacOS the windows prompt command:"ipconfig /all" will become:"ifconfig -a" on the Terminal.