node-modules / address

Get current machine IP and MAC address.
Other
233 stars 32 forks source link

address.mac doesn't return mac address if iface doesn't have ip #6

Open nekuz0r opened 10 years ago

nekuz0r commented 10 years ago

The address.mac function doesn't return the mac address of the iface if it doesn't have an ip address.

I only test it under linux, but i can see in the source code the getMAC function uses the ip address of the interface to match the interface. I don't really understand why this check is done since multiple interface can't have the same name. What happens if an interface have secondaries ip address ? ifconfig IFACE or ip link show IFACE returns the configuration of the named interface only.