Trust me I have done that. But thanks for the suggestion.
So here's the thing. I have found out how the redirection ACTUALLY works via some digging around in the source code
https://github.com/hakko/subsonic/blob/ ... rvice.java around line 232
Basically this is the array that gets used during redirection, and lo and behold, LOCAL IP address IS involved in the actual redirection. The fault lies in the in line
- Code: Select all
params.add(new BasicNameValuePair("localIp", Util.getLocalIpAddress()));
Which after searching appears to simply return the first non-loopback IP address of the server. In most cases this would be the LAN IP address, but depending on the behind the scenes ordering of the network adapters, as seen by java itself (I think) other adaptors can sometimes take precedence. Think of it like running ipconfig on windows, and imagine that this returned list also includes loopback adapters. The order things show up isnt necessarily gonna be the same on all machines. And for this case it would appear that on my machine, the VPN adapter's IP is reported first, before the LAN adapter's IP. I found another post on these forums expressing this as a bug:
viewtopic.php?f=5&t=12001&start=15I am not sure if this would be a bug in java itself (I think it would be, or more just a shortcoming or a case of this not really being the right thing to use to report Local IP in the way we need) or if this is actually a bug in subsonic itself.
So to summarize:
The redirection DOES involve local IP, though I dont know how it uses it. But it would appear the method for obtaining the "Local IP" shows very little care over WHICH local IP, and due to there being no way to manually specify via adapter ID or by manually entering the local IP, I am left with being stuck with it reporting my VPN IP, just because that is first in the report when it gets it's value for non-loopback IP list.
So I guess next in my list is building from source and simply (as a test) hardwiring the localip value in the array to 192.168.1.10, skipping the Until.getLocalIpAddress() function.
Now if only I knew anything about how to do that

I guess it's time to try and get my eclipse development environment going again...
Until then, how can this be reported as a "potential" bug for future investigation by people who know more than I do?

EDIT: to be clearer, the fault (or more accurately the shortcoming) is in this file
https://github.com/hakko/subsonic/blob/ ... /Util.java where the class getLocalIpAddress is defined.
- Code: Select all
public static String getLocalIpAddress() {
try {
// Try the simple way first.
InetAddress address = InetAddress.getLocalHost();
if (!address.isLoopbackAddress()) {
return address.getHostAddress();
}
// Iterate through all network interfaces, looking for a suitable IP.
Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces();
while (interfaces.hasMoreElements()) {
NetworkInterface iface = interfaces.nextElement();
Enumeration<InetAddress> addresses = iface.getInetAddresses();
while (addresses.hasMoreElements()) {
InetAddress addr = addresses.nextElement();
if (addr instanceof Inet4Address && !addr.isLoopbackAddress()) {
return addr.getHostAddress();
}
}
}
} catch (Throwable x) {
LOG.warn("Failed to resolve local IP address.", x);
}
return "127.0.0.1";
}
I'm going to fiddle with that once I get it building properly, and if I find a more robust way of finding the proper local IP address, I'll try to submit a merge request. But a forwarning, I am VERY new to java development and I know jack shit about github

so anyone feel free to extend it in place of me.