(03-09-2015 01:33 PM)simonc Wrote: Thanks for looking into this. Your conclusions were very helpful!
While I'm sure your patch works, I think a smaller set of changes might be possible. Could you check whether the patch below also fixes the bug please?
Code:
diff --git a/OpenHome/Net/Device/Upnp/DviProtocolUpnp.cpp b/OpenHome/Net/Device/Upnp/DviProtocolUpnp.cpp
index 38c6db3..0533b95 100644
--- a/OpenHome/Net/Device/Upnp/DviProtocolUpnp.cpp
+++ b/OpenHome/Net/Device/Upnp/DviProtocolUpnp.cpp
@@ -155,10 +155,10 @@ void DviProtocolUpnp::HandleInterfaceChange()
AutoNetworkAdapterRef ref(iDvStack.Env(), "DviProtocolUpnp::HandleInterfaceChange");
const NetworkAdapter* current = ref.Adapter();
TUint i = 0;
- if (current != NULL) {
+ if (adapterList.SingleSubnetModeEnabled()) {
// remove listeners whose interface is no longer available
while (i<iAdapters.size()) {
- if (iAdapters[i]->Interface() == current->Address()) {
+ if (current != NULL && iAdapters[i]->Interface() == current->Address()) {
i++;
}
else {
@@ -167,7 +167,7 @@ void DviProtocolUpnp::HandleInterfaceChange()
iAdapters.erase(iAdapters.begin() + i);
}
// add listener if 'current' is a new subnet
- if (iAdapters.size() == 0) {
+ if (iAdapters.size() == 0 && current != NULL) {
iDvStack.SsdpNotifierManager().Stop(iDevice.Udn());
DviProtocolUpnpAdapterSpecificData* adapter = AddInterface(*current);
if (iDevice.Enabled()) {
I've just checked and it doesn't fix this issue. I do not investigate it a lot.
In my opinion clue is to return NULL adapter if port is 0