summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordlg <dlg@openbsd.org>2019-01-21 07:16:28 +0000
committerdlg <dlg@openbsd.org>2019-01-21 07:16:28 +0000
commit5eb1e7469b8e43e1ab2d8bd4c30a1403f1e5ff9d (patch)
tree459db6410814cf6ad2818777a73122b83f108f19
parent- -T was added to the first synopsis by mistake (diff)
downloadwireguard-openbsd-5eb1e7469b8e43e1ab2d8bd4c30a1403f1e5ff9d.tar.xz
wireguard-openbsd-5eb1e7469b8e43e1ab2d8bd4c30a1403f1e5ff9d.zip
explicitly handle printing the AF_KEY socket type as "pfkey"
i was looking for it and had to think very hard and read /usr/include/sys/socket.h before i found it here. ok deraadt@ ok claudio@ who wanted it to look like AF_ROUTE output
-rw-r--r--usr.bin/fstat/fstat.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.bin/fstat/fstat.c b/usr.bin/fstat/fstat.c
index 3671baa863a..f694d3bdfd8 100644
--- a/usr.bin/fstat/fstat.c
+++ b/usr.bin/fstat/fstat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fstat.c,v 1.95 2018/09/16 02:44:06 millert Exp $ */
+/* $OpenBSD: fstat.c,v 1.96 2019/01/21 07:16:28 dlg Exp $ */
/*
* Copyright (c) 2009 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -788,6 +788,11 @@ socktrans(struct kinfo_file *kf)
printf(" %d ", kf->so_protocol);
hide((void *)(uintptr_t)kf->f_data);
break;
+ case AF_KEY:
+ printf("* pfkey %s", stype);
+ printf(" %d ", kf->so_protocol);
+ hide((void *)(uintptr_t)kf->f_data);
+ break;
default:
/* print protocol number and socket address */
printf("* %d %s", kf->so_family, stype);