-/* $OpenBSD: pf_ioctl.c,v 1.385 2022/08/06 15:57:58 bluhm Exp $ */
+/* $OpenBSD: pf_ioctl.c,v 1.386 2022/11/06 13:03:52 dlg Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
#include <sys/proc.h>
#include <sys/rwlock.h>
#include <sys/syslog.h>
+#include <sys/specdev.h>
#include <uvm/uvm_extern.h>
#include <crypto/md5.h>
int
pfopen(dev_t dev, int flags, int fmt, struct proc *p)
{
- if (minor(dev) >= 1)
+ int unit = minor(dev);
+
+ if (unit & ((1 << CLONE_SHIFT) - 1))
return (ENXIO);
+
return (0);
}
int
pfclose(dev_t dev, int flags, int fmt, struct proc *p)
{
- if (minor(dev) >= 1)
- return (ENXIO);
return (0);
}
-/* $OpenBSD: conf.h,v 1.159 2022/09/02 20:06:56 miod Exp $ */
+/* $OpenBSD: conf.h,v 1.160 2022/11/06 13:03:52 dlg Exp $ */
/* $NetBSD: conf.h,v 1.33 1996/05/03 20:03:32 christos Exp $ */
/*-
dev_init(c,n,open), dev_init(c,n,close), (dev_type_read((*))) enodev, \
(dev_type_write((*))) enodev, dev_init(c,n,ioctl), \
(dev_type_stop((*))) enodev, 0, \
- (dev_type_mmap((*))) enodev }
+ (dev_type_mmap((*))) enodev, 0, D_CLONE }
/* open, close, read, write, ioctl, kqfilter */
#define cdev_usbdev_init(c,n) { \