summaryrefslogtreecommitdiffstats
path: root/sys/dev/vnd.c
diff options
context:
space:
mode:
authorkrw <krw@openbsd.org>2009-06-04 05:57:27 +0000
committerkrw <krw@openbsd.org>2009-06-04 05:57:27 +0000
commit6cec478daa57fb321742a619109b780f96be0101 (patch)
treee7a399c62c1929febb672809d9a612f5cbe02ac5 /sys/dev/vnd.c
parentadd -DINET6 to CFLAGS to make the client handle the bracketed IPv6 host (diff)
downloadwireguard-openbsd-6cec478daa57fb321742a619109b780f96be0101.tar.xz
wireguard-openbsd-6cec478daa57fb321742a619109b780f96be0101.zip
Add DIOCRLDINFO to those drivers previously deprived.
Noticed by & ok deraadt@
Diffstat (limited to 'sys/dev/vnd.c')
-rw-r--r--sys/dev/vnd.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/sys/dev/vnd.c b/sys/dev/vnd.c
index 1ac734d5233..8cbda77ef91 100644
--- a/sys/dev/vnd.c
+++ b/sys/dev/vnd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vnd.c,v 1.91 2009/06/03 22:09:30 thib Exp $ */
+/* $OpenBSD: vnd.c,v 1.92 2009/06/04 05:57:27 krw Exp $ */
/* $NetBSD: vnd.c,v 1.26 1996/03/30 23:06:11 christos Exp $ */
/*
@@ -749,6 +749,7 @@ int
vndioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p)
{
int unit = vndunit(dev);
+ struct disklabel *lp;
struct vnd_softc *vnd;
struct vnd_ioctl *vio;
struct vnd_user *vnu;
@@ -945,6 +946,15 @@ vndioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p)
break;
+ case DIOCRLDINFO:
+ if ((vnd->sc_flags & VNF_HAVELABEL) == 0)
+ return (ENOTTY);
+ lp = malloc(sizeof(*lp), M_TEMP, M_WAITOK);
+ vndgetdisklabel(dev, vnd, lp, 0);
+ *(vnd->sc_dk.dk_label) = *lp;
+ free(lp, M_TEMP);
+ return (0);
+
case DIOCGPDINFO:
if ((vnd->sc_flags & VNF_HAVELABEL) == 0)
return (ENOTTY);