Bug into NetworkModule in Gadgeteer 4.1 and 4.2


The property "NetworkSettings" of "NetworkModule" class will always return the first Network interface.

The problem is in the for loop.
for (int b = 0; b < physicalAddress.Length; b++)
    if (netif.PhysicalAddress[b] != physicalAddress[b]) continue;

The "continue" is applied to the "for" loop but you want to apply it to the "foreach" loop.
Because of it, the "if" condition is useless.
The "for" loop becomes useless too.
So the "return netif;" is always executed and than the first network interface is always returned.
Closed Apr 19, 2013 at 11:48 PM by JanKuceraMSFT
Fixed for the upcoming release.