[Bug 194660] lang/mono Use netstat to get routes instead of /proc/net/route
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Thu Nov 6 10:09:23 UTC 2014
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=194660
--- Comment #8 from Romain Tartière <romain at FreeBSD.org> ---
The "problem" is that this implementation spawns a new process, and this kind
of situation should be avoided if possible. Moreover, each netstat
implementation will have slight differences in it's output, so the code might
quickly become hard to maintain…
Since executing netstat look nearly unavoidable on FreeBSD (and maybe MacOS),
using a switch / case to detect the platform and do the right thing (read
/proc/net/route on Linux, run and parse FreeBSD's netstat output on FreeBSD,
run and parse MacOS's netstat output on MacOS, …) instead of trying one
solution and falling back on another would be more elegant (think about the
code you changed in attachment 149099).
While here, using a full path to the program would be more reliable (in case
$PATH does not contain a 'netstat' command or if the user has a custom
'netstat' in his PATH that takes precedence).
There may be additional things to take into account, I guess the mono team
would help formalizing this. I'll point them here so that they may provide
further feedback.
--
You are receiving this mail because:
You are on the CC list for the bug.
You are the assignee for the bug.
More information about the freebsd-mono
mailing list