diff options
author | Michael Tuexen <tuexen@FreeBSD.org> | 2024-02-16 11:28:48 +0000 |
---|---|---|
committer | Michael Tuexen <tuexen@FreeBSD.org> | 2024-02-16 11:28:48 +0000 |
commit | e00fd24262945fdc7f16198c8abd977f743e66e4 (patch) | |
tree | f75b194c5cc0072733030b78b613abbaf01df969 | |
parent | 2f4e46dfdd710c6679f233480c9de430e6c4ef9b (diff) | |
download | src-e00fd24262945fdc7f16198c8abd977f743e66e4.tar.gz src-e00fd24262945fdc7f16198c8abd977f743e66e4.zip |
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
-rw-r--r-- | cddl/lib/libdtrace/ip.d | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cddl/lib/libdtrace/ip.d b/cddl/lib/libdtrace/ip.d index 172d7d54bc36..2fe98858efc2 100644 --- a/cddl/lib/libdtrace/ip.d +++ b/cddl/lib/libdtrace/ip.d @@ -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; }; |