Ignore null or empty interface names in EthernetTracker.

If EthernetTracker ever gets a null or empty interface name from a
netlink message, it will crash the system. This likely cannot happen,
but because the code runs all the time on all interfaces that have a
MAC address, it seems safer to have a check for it.

Test: None
Flag: EXEMPT bugfix
Change-Id: Iff93de9a42e5d8aa51e0183b45608c808ef31c38
This commit is contained in:
Lorenzo Colitti 2025-07-03 04:42:26 -07:00
commit 28961f7464

View file

@ -287,6 +287,8 @@ public class EthernetTracker {
// (for existing interfaces). Up until then, this code runs for every network interface
// on the system.
final String ifname = msg.getInterfaceName();
if (TextUtils.isEmpty(ifname)) return; // TODO: can this happen?
final EthernetPort port = new EthernetPort(ifname, mac, ifinfomsg.index);
switch (msg.getHeader().nlmsg_type) {