Get local active IP address
The active IP address would be the one actually used to communicate on the network. In most cases a PC has the ethernet port used as primary and the wifi network used as secondary (or vice versa). If you switch from one to the other you create a situation where both network devices have a valid IP but only one of the two is actually used based on the active connection at that time.