Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Nov 2024 22:21:01 GMT
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 7678dac43714 - main - ktrace: support AF_NETLINK in ktrstruct
Message-ID:  <202411192221.4AJML1qc014755@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by glebius:

URL: https://cgit.FreeBSD.org/src/commit/?id=7678dac437149a8af7cbbc2c8b067c9096143320

commit 7678dac437149a8af7cbbc2c8b067c9096143320
Author:     Artem Hevorhian <artemhevorhian@gmail.com>
AuthorDate: 2024-11-19 22:19:15 +0000
Commit:     Gleb Smirnoff <glebius@FreeBSD.org>
CommitDate: 2024-11-19 22:19:50 +0000

    ktrace: support AF_NETLINK in ktrstruct
    
    Right now, sockaddr_nl parameters are not displayed in kdump output,
    however they are present in the structure in ktrace.out file when
    ktrace is run.
    
    Reviewed by:            melifaro, markj, glebius
    Differential Revision:  https://reviews.freebsd.org/D47411
---
 usr.bin/kdump/kdump.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/usr.bin/kdump/kdump.c b/usr.bin/kdump/kdump.c
index f104c20f3842..48f645c339b9 100644
--- a/usr.bin/kdump/kdump.c
+++ b/usr.bin/kdump/kdump.c
@@ -59,6 +59,7 @@
 #endif
 #include <arpa/inet.h>
 #include <netinet/in.h>
+#include <netlink/netlink.h>
 #include <ctype.h>
 #include <capsicum_helpers.h>
 #include <err.h>
@@ -1944,6 +1945,15 @@ ktrsockaddr(struct sockaddr *sa)
 		printf("%.*s", (int)sizeof(sa_un.sun_path), sa_un.sun_path);
 		break;
 	}
+	case AF_NETLINK: {
+		struct sockaddr_nl sa_nl;
+
+		memset(&sa_nl, 0, sizeof(sa_nl));
+		memcpy(&sa_nl, sa, sa->sa_len);
+		printf("netlink[pid=%u, groups=0x%x]",
+		    sa_nl.nl_pid, sa_nl.nl_groups);
+		break;
+	}
 	default:
 		printf("unknown address family");
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202411192221.4AJML1qc014755>