dtrace: allow NULL interface pointer for ifinfo_t translator

This is similar to other translators and will be used in static
probes where the interface is not known.

Reviewed by:		markj
MFC after:		1 week
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D43728
This commit is contained in:
Michael Tuexen 2024-02-16 12:28:48 +01:00
parent 2f4e46dfdd
commit e00fd24262

View file

@ -262,8 +262,8 @@ inline int IFF_LOOPBACK = 0x8;
#pragma D binding "1.5" translator
translator ifinfo_t < struct ifnet *p > {
if_name = p->if_xname;
if_local = (p->if_flags & IFF_LOOPBACK) == 0 ? 0 : 1;
if_name = p == NULL ? "<unknown>" : p->if_xname;
if_local = p == NULL ? 0 : (p->if_flags & IFF_LOOPBACK) == 0 ? 0 : 1;
if_addr = (uintptr_t)p;
};