weskoerber / mac_address

A cross-platform library to retrieve the MAC address from your network interfaces without libc.
https://weskoerber.github.io/mac_address/
MIT License
2 stars 1 forks source link

Remove `is_loopback` field from `MacAddress` struct #8

Closed weskoerber closed 2 months ago

weskoerber commented 6 months ago

This is just dirty... It was initially done to support getFirstNoLoopback on Linux, but it's really an internal implementation detail that leaked into a public interface. Loopback detection and optional exclusion should be done internally -- if a user calls getFirstNoLoopback, is_loopback will obviously be false! Seems like a waste of space.

I think there's benefit to it somewhere, like if we were gonna make the MacAddress struct any more than just a slim wrapper around a [6]u8. However, at least for now, I think it's better to keep the scope narrow.