Bug 194845 - lang/mono Use mono Mac NetworkInterface code instead of Linux NetworkInterface code
Summary: lang/mono Use mono Mac NetworkInterface code instead of Linux NetworkInterfac...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-mono mailing list
URL: https://github.com/mono/mono/pull/1390
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-05 23:01 UTC by Ben Woods
Modified: 2014-11-10 14:24 UTC (History)
1 user (show)

See Also:
woodsb02: maintainer-feedback? (mono)


Attachments
PR194845: Use Mac code in mcs/class/System/System.Net.NetworkInformation/NetworkInterface.cs (505 bytes, patch)
2014-11-05 23:02 UTC, Ben Woods
no flags Details | Diff
PR194845: Allow FreeBSD OS detection (1.73 KB, patch)
2014-11-05 23:03 UTC, Ben Woods
no flags Details | Diff
PR194845: Use Mac code within mono/metadata/socket-io.c (1.29 KB, patch)
2014-11-05 23:05 UTC, Ben Woods
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ben Woods freebsd_committer 2014-11-05 23:01:34 UTC
The FreeBSD mono port is currently configured to use the mono Linux NetworkInterface code, which contains some Linuxisms (such as parsing files in /sys/class/net/). Refer to the code here:
https://github.com/mono/mono/blob/master/mcs/class/System/System.Net.NetworkInformation/NetworkInterface.cs

The FreeBSD mono port should be changed to use the Mac NetworkInterface code which works fine. Refer to the above link which shows class MacOsNetworkInterface : UnixNetworkInterface.
Comment 1 Bugzilla Automation freebsd_committer 2014-11-05 23:01:34 UTC
Auto-assigned to maintainer mono@FreeBSD.org
Comment 2 Ben Woods freebsd_committer 2014-11-05 23:02:46 UTC
Created attachment 149098 [details]
PR194845: Use Mac code in mcs/class/System/System.Net.NetworkInformation/NetworkInterface.cs
Comment 3 Ben Woods freebsd_committer 2014-11-05 23:03:18 UTC
Created attachment 149099 [details]
PR194845: Allow FreeBSD OS detection
Comment 4 Ben Woods freebsd_committer 2014-11-05 23:05:56 UTC
Created attachment 149100 [details]
PR194845: Use Mac code within mono/metadata/socket-io.c

Copy the code used on Apple since mono/metadata/socket-io.c cannot yet "walk the result of struct ifconf". This was causing ves_icall_System_Net_Dns_GetHostByName_internal to return strange IP addresses.
Comment 5 Romain Tartière freebsd_committer 2014-11-06 08:55:00 UTC
Hi!

Does this also solve #194660 ?

Thanks!
Comment 6 Ben Woods freebsd_committer 2014-11-06 09:18:11 UTC
Hi Romain,
No. PR194660 is a separate issue to this. There is a separate patch already attached to that bug.
Both bugs are standalone, with their own independent patches already attached.
Comment 7 Romain Tartière freebsd_committer 2014-11-06 09:28:03 UTC
Thank you for your feedback.

Has this been reported upstream?  If no, may I ask you to do so?

As far as I am concerned, these patches looks more acceptable than the one attached to #194660 (in respect to the comments in github's bug report), and I would just want to know what the mono buddies think about this before adding more local patches since it's a PITA to maintain them :-)
Comment 8 Ben Woods freebsd_committer 2014-11-06 09:36:43 UTC
Pull request has been submitted upstream: https://github.com/mono/mono/pull/1390

Regarding PR194660, there were some initial teething issues with my patch, but it is all rectified now and should work fine. In fact that patch is even required for Mac OSX. However, as already stated, that is a separate issue to this PR (both are needed).
Comment 9 Ben Woods freebsd_committer 2014-11-10 01:28:58 UTC
These patches have now been accepted into upstream mono:
https://github.com/mono/mono/pull/1390

What should we do with this PR? Close it and wait for next mono release, or update port to include patches until next mono release comes out?
Comment 10 commit-hook freebsd_committer 2014-11-10 14:23:44 UTC
A commit references this bug:

Author: romain
Date: Mon Nov 10 14:23:13 UTC 2014
New revision: 372396
URL: https://svnweb.freebsd.org/changeset/ports/372396

Log:
  Use Mac NetworkInterface code instead of Linux NetworkInterface code

  PR:		194845
  Submitted by:	Ben Woods <woodsb02@gmail.com>

Changes:
  head/lang/mono/Makefile
  head/lang/mono/distinfo
Comment 11 Romain Tartière freebsd_committer 2014-11-10 14:24:27 UTC
Upstream patch added, thanks!