Skip to content

Commit

Permalink
Do not bind to VirtualBox interfaces by default
Browse files Browse the repository at this point in the history
  • Loading branch information
ened committed Apr 14, 2015
1 parent 0451fc9 commit 2a30fc5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,7 @@ protected void discoverNetworkInterfaces() throws InitializationException {
* <li>have no bound IP addresses</li>
* <li>named "vmnet*" (OS X VMWare does not properly stop interfaces when it quits)</li>
* <li>named "vnic*" (OS X Parallels interfaces should be ignored as well)</li>
* <li>named "vboxnet*" (OS X Virtual Box interfaces should be ignored as well)</li>
* <li>named "*virtual*" (VirtualBox interfaces, for example</li>
* <li>named "ppp*"</li>
* </ul>
Expand Down Expand Up @@ -359,6 +360,11 @@ protected boolean isUsableNetworkInterface(NetworkInterface iface) throws Except
return false;
}

if (iface.getName().toLowerCase(Locale.ROOT).startsWith("vboxnet")) {
log.finer("Skipping network interface (Virtual Box): " + iface.getDisplayName());
return false;
}

if (iface.getName().toLowerCase(Locale.ROOT).contains("virtual")) {
log.finer("Skipping network interface (named '*virtual*'): " + iface.getDisplayName());
return false;
Expand Down
5 changes: 3 additions & 2 deletions core/src/manual/basicapi/upnpservice.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,9 @@
The <code>NetworkAddressFactory</code> provides the network interfaces, ports, and
multicast settings which are used by the UPnP stack. At the time of writing, the following
interfaces and IP addresses are ignored by the default configuration: any IPv6 interfaces
and addresses, interfaces whose name is "vmnet*", "vnic*", "*virtual*", or "ppp*", and the
local loopback. Otherwise, all interfaces and their TCP/IP addresses are used and bound.
and addresses, interfaces whose name is "vmnet*", "vnic*", "vboxnet*", "*virtual*", or
"ppp*", and the local loopback. Otherwise, all interfaces and their TCP/IP addresses are
used and bound.
</p>
<p>
You can set the system property <code>org.fourthline.cling.network.useInterfaces</code> to
Expand Down

0 comments on commit 2a30fc5

Please sign in to comment.