mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-22 03:04:34 +01:00
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:
parent
2f4e46dfdd
commit
e00fd24262
@ -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;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user