Commit Graph

5 Commits

Author SHA1 Message Date
Cuong Manh Le d1ea70d688 fix: prevent panic on network change during SetSelfIP
SetSelfIP unconditionally accessed t.dhcp, but t.dhcp is only
initialized when DHCP discovery is enabled. A network change event
can fire SetSelfIP regardless of the discovery configuration,
causing a nil pointer dereference.

Guard the t.dhcp access with a nil check so the self IP is still
updated on the Table even when DHCP discovery is disabled.
2026-04-22 15:30:59 +07:00
Cuong Manh Le 5d65416227 internal/clientinfo: fill empty hostname based on MAC address
An interface may have multiple MAC addresses, that leads to the problem
when looking up hostname for its multiple <ip, mac> pairs, because the
"ip" map, which storing "mac => ip" mapping can only store 1 entry. It
ends up returns an empty hostname for a known MAC address.

Fixing this by filling empty hostname based on clients which is already
listed, ensuring all clients with the same MAC address will have the
same hostname information.
2024-02-07 14:39:34 +07:00
Cuong Manh Le 63f959c951 all: spoof loopback ranges in client info
Sending them are useless, so using RFC1918 address instead.
2023-11-06 20:01:57 +07:00
Cuong Manh Le 76d2e2c226 Improving Mac discovery 2023-08-09 23:54:23 +07:00
Cuong Manh Le 9fe6af684f all: watch lease files if send client info enabled
So users who run ctrld in Linux can still see clients info, even though
it's not an router platform that ctrld supports.
2023-08-09 23:54:23 +07:00