You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Layer 3 network devices aren't assigned a MAC address since they're not at the physical data link layer. This can cause confusion between a MAC address that is the loopback and a MAC address that's a layer 3 device.
Consider the following:
❯ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host noprefixroute
valid_lft forever preferred_lft forever
2: tailscale0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1280 qdisc fq_codel state UNKNOWN group default qlen 500
link/none
inet 100.107.149.105/32 scope global tailscale0
valid_lft forever preferred_lft forever
inet6 fd7a:115c:a1e0:ab12:4843:cd96:626b:9569/128 scope global
valid_lft forever preferred_lft forever
inet6 fe80::4c60:e0c2:4fc:cab1/64 scope link stable-privacy proto kernel_ll
valid_lft forever preferred_lft forever
3: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default
link/ether 02:42:37:65:32:3d brd ff:ff:ff:ff:ff:ff
inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
valid_lft forever preferred_lft forever
In this example, the first non-loopback device is tailscale0 whose MAC address is 00:00:00:00:00:00. How is the user supposed to know the difference between this and the loopback?
I think the data field in the MacAddress struct should be optional, and set to null if the device doesn't have a MAC address. This would disambiguate the loopback device from a layer 3 device, while also being more true to form.
However, this library is called "mac_address". If layer 3 devices do not have MAC addresses, should we even consider them at all?
The text was updated successfully, but these errors were encountered:
This is sort of a follow-up from #9.
Layer 3 network devices aren't assigned a MAC address since they're not at the physical data link layer. This can cause confusion between a MAC address that is the loopback and a MAC address that's a layer 3 device.
Consider the following:
In this example, the first non-loopback device is
tailscale0
whose MAC address is00:00:00:00:00:00
. How is the user supposed to know the difference between this and the loopback?I think the
data
field in theMacAddress
struct should be optional, and set tonull
if the device doesn't have a MAC address. This would disambiguate the loopback device from a layer 3 device, while also being more true to form.However, this library is called "mac_address". If layer 3 devices do not have MAC addresses, should we even consider them at all?
The text was updated successfully, but these errors were encountered: