OpenHome Forum
Single subnet mode not working correctly - Printable Version

+- OpenHome Forum (http://forum.openhome.org)
+-- Forum: OpenHome (/forumdisplay.php?fid=1)
+--- Forum: Net (/forumdisplay.php?fid=5)
+--- Thread: Single subnet mode not working correctly (/showthread.php?tid=1733)



Single subnet mode not working correctly - simoncn - 05-11-2017 09:26 PM

I'm sorry to say that the patch I submitted in this post is incorrect. It selects the correct adapter(s) when ohNet starts, but things go wrong when there is a change to the adapter configuration.

The code in line 116 of DviServer.cpp should be similar to the code in lines 104-107 but it isn't. This can cause additional adapters to be added that should be excluded by the single subnet setting. Similarly, the code in line 178 of DviProtocolUpnp.cpp should be similar to the code in lines 162-165 for the same reason.

It is easy to demonstrate the problem by doing the following:

1) Start ohNet on a machine with adapters A, B and C (on different subnets) with a single subnet setting for adapter A
2) ohNet advertises and listens (correctly) on adapter A only
3) Disable adapter B
4) ohNet advertises and listens (incorrectly) on adapters A and C
5) Enable adapter B
6) ohNet advertises and listens (incorrectly) on adapters A, B and C

This can cause problems when there are some adapters that are not suitable for use by ohNet and would cause ohNet to crash if they were not excluded. For example, this can happen with some VPN adapters.

I am attaching a patch to fix this problem. I have checked it very carefully and I have tested it on 1.17.2735 and I am sure that it is correct.


RE: Single subnet mode not working correctly - simonc - 15-11-2017 02:18 PM

Thanks for the patch. I've applied it now.


RE: Single subnet mode not working correctly - simoncn - 15-11-2017 05:43 PM

Many thanks and apologies again for my oversight with the initial patch!