summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/libc/sys/kqueue.220
-rw-r--r--sys/kern/kern_event.c2
-rw-r--r--sys/net/if.c9
-rw-r--r--sys/sys/event.h9
-rw-r--r--tools/regression/fifo/fifo_misc/fifo_misc.c109
-rw-r--r--usr.bin/truss/syscalls.c2
6 files changed, 4 insertions, 147 deletions
diff --git a/lib/libc/sys/kqueue.2 b/lib/libc/sys/kqueue.2
index e899a1b..326632d 100644
--- a/lib/libc/sys/kqueue.2
+++ b/lib/libc/sys/kqueue.2
@@ -438,19 +438,6 @@ There is a system wide limit on the number of timers
which is controlled by the
.Va kern.kq_calloutmax
sysctl.
-.It Dv EVFILT_NETDEV
-Takes a descriptor to a network interface as the identifier, and the events to watch for in
-.Va fflags .
-It returns, when one or more of the requested events occur on the descriptor.
-The events to monitor are:
-.Bl -tag -width XXNOTE_LINKDOWN
-.It Dv NOTE_LINKUP
-The link is up.
-.It Dv NOTE_LINKDOWN
-The link is down.
-.It Dv NOTE_LINKINV
-The link state is invalid.
-.El
.Pp
On return,
.Va fflags
@@ -595,13 +582,6 @@ system and this manual page were written by
.An Jonathan Lemon Aq jlemon@FreeBSD.org .
.Sh BUGS
The
-.Dv EVFILT_NETDEV
-filter is currently only implemented for devices that use the
-.Xr miibus 4
-driver for LINKUP and LINKDOWN operations.
-Therefore, it will not work with many non-ethernet devices.
-.Pp
-The
.Fa timeout
value is limited to 24 hours; longer timeouts will be silently
reinterpreted as 24 hours.
diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c
index 47a17fb..ad0acd8 100644
--- a/sys/kern/kern_event.c
+++ b/sys/kern/kern_event.c
@@ -264,7 +264,7 @@ static struct {
{ &proc_filtops }, /* EVFILT_PROC */
{ &sig_filtops }, /* EVFILT_SIGNAL */
{ &timer_filtops }, /* EVFILT_TIMER */
- { &file_filtops }, /* EVFILT_NETDEV */
+ { &null_filtops }, /* former EVFILT_NETDEV */
{ &fs_filtops }, /* EVFILT_FS */
{ &null_filtops }, /* EVFILT_LIO */
{ &user_filtops }, /* EVFILT_USER */
diff --git a/sys/net/if.c b/sys/net/if.c
index 7ffa268..fe0a304 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -1878,19 +1878,12 @@ do_link_state_change(void *arg, int pending)
{
struct ifnet *ifp = (struct ifnet *)arg;
int link_state = ifp->if_link_state;
- int link;
CURVNET_SET(ifp->if_vnet);
/* Notify that the link state has changed. */
rt_ifmsg(ifp);
- if (link_state == LINK_STATE_UP)
- link = NOTE_LINKUP;
- else if (link_state == LINK_STATE_DOWN)
- link = NOTE_LINKDOWN;
- else
- link = NOTE_LINKINV;
if (ifp->if_vlantrunk != NULL)
- (*vlan_link_state_p)(ifp, link);
+ (*vlan_link_state_p)(ifp, 0);
if ((ifp->if_type == IFT_ETHER || ifp->if_type == IFT_L2VLAN) &&
IFP2AC(ifp)->ac_netgraph != NULL)
diff --git a/sys/sys/event.h b/sys/sys/event.h
index 4365e44..d92eb55 100644
--- a/sys/sys/event.h
+++ b/sys/sys/event.h
@@ -38,7 +38,7 @@
#define EVFILT_PROC (-5) /* attached to struct proc */
#define EVFILT_SIGNAL (-6) /* attached to struct proc */
#define EVFILT_TIMER (-7) /* timers */
-#define EVFILT_NETDEV (-8) /* network devices */
+/* EVFILT_NETDEV (-8) no longer supported */
#define EVFILT_FS (-9) /* filesystem events */
#define EVFILT_LIO (-10) /* attached to lio requests */
#define EVFILT_USER (-11) /* User events */
@@ -131,13 +131,6 @@ struct kevent {
#define NOTE_TRACKERR 0x00000002 /* could not track child */
#define NOTE_CHILD 0x00000004 /* am a child process */
-/*
- * data/hint flags for EVFILT_NETDEV, shared with userspace
- */
-#define NOTE_LINKUP 0x0001 /* link is up */
-#define NOTE_LINKDOWN 0x0002 /* link is down */
-#define NOTE_LINKINV 0x0004 /* link state is invalid */
-
struct knote;
SLIST_HEAD(klist, knote);
struct kqueue;
diff --git a/tools/regression/fifo/fifo_misc/fifo_misc.c b/tools/regression/fifo/fifo_misc/fifo_misc.c
index b379d18..d0a2cf7 100644
--- a/tools/regression/fifo/fifo_misc/fifo_misc.c
+++ b/tools/regression/fifo/fifo_misc/fifo_misc.c
@@ -148,114 +148,6 @@ test_truncate(void)
cleanfifo("testfifo", -1, -1);
}
-struct filter_entry {
- int fe_filter;
- const char *fe_name;
- int fe_error;
- const char *fe_errorname;
-};
-
-static const struct filter_entry good_filter_types[] = {
- { EVFILT_READ, "EVFILT_READ", 0, "0" },
- { EVFILT_WRITE, "EVFILT_WRITE", 0, "0" },
-#if WORKING_EVFILT_VNODE_ON_FIFOS
- { EVFILT_VNODE, "EVFILT_VNODE", EINVAL, "EINVAL" },
-#endif
-};
-static const int good_filter_types_len = sizeof(good_filter_types) /
- sizeof(good_filter_types[0]);
-
-static const struct filter_entry bad_filter_types[] = {
- { EVFILT_NETDEV, "EVFILT_NETDEV", EINVAL, "EINVAL" },
-};
-static const int bad_filter_types_len = sizeof(bad_filter_types) /
- sizeof(bad_filter_types[0]);
-
-/*
- * kqueue event-related tests are in fifo_io.c; however, that tests only
- * valid invocations of kqueue. Check to make sure that some invalid filters
- * that are generally allowed on file descriptors are not allowed to be
- * registered with kqueue, and that if attempts are made, we get the right
- * error.
- */
-static void
-test_kqueue(void)
-{
- int kqueue_fd, reader_fd, writer_fd;
- struct kevent kev_set;
- struct timespec timeout;
- int i, ret;
-
- makefifo("testfifo", __func__);
-
- if (openfifo("testfifo", __func__, &reader_fd, &writer_fd) < 0) {
- warn("%s: openfifo", __func__);
- cleanfifo("testfifo", -1, -1);
- exit(-1);
- }
-
- kqueue_fd = kqueue();
- if (kqueue_fd < 0) {
- warn("%s: kqueue", __func__);
- cleanfifo("testfifo", reader_fd, writer_fd);
- exit(-1);
- }
-
- timeout.tv_sec = 0;
- timeout.tv_nsec = 0;
-
- for (i = 0; i < good_filter_types_len; i++) {
- bzero(&kev_set, sizeof(kev_set));
- EV_SET(&kev_set, reader_fd, good_filter_types[i].fe_filter,
- EV_ADD, 0, 0, 0);
- ret = kevent(kqueue_fd, &kev_set, 1, NULL, 0, &timeout);
- if (ret < 0) {
- warn("%s: kevent: adding good filter %s", __func__,
- good_filter_types[i].fe_name);
- close(kqueue_fd);
- cleanfifo("testfifo", reader_fd, writer_fd);
- exit(-1);
- }
- bzero(&kev_set, sizeof(kev_set));
- EV_SET(&kev_set, reader_fd, good_filter_types[i].fe_filter,
- EV_DELETE, 0, 0, 0);
- ret = kevent(kqueue_fd, &kev_set, 1, NULL, 0, &timeout);
- if (ret < 0) {
- warn("%s: kevent: deleting good filter %s", __func__,
- good_filter_types[i].fe_name);
- close(kqueue_fd);
- cleanfifo("testfifo", reader_fd, writer_fd);
- exit(-1);
- }
- }
-
- for (i = 0; i < bad_filter_types_len; i++) {
- bzero(&kev_set, sizeof(kev_set));
- EV_SET(&kev_set, reader_fd, bad_filter_types[i].fe_filter,
- EV_ADD, 0, 0, 0);
- ret = kevent(kqueue_fd, &kev_set, 1, NULL, 0, &timeout);
- if (ret >= 0) {
- warnx("%s: kevent: bad filter %s succeeded, expected "
- "EINVAL", __func__, bad_filter_types[i].fe_name);
- close(kqueue_fd);
- cleanfifo("testfifo", reader_fd, writer_fd);
- exit(-1);
- }
- if (errno != bad_filter_types[i].fe_error) {
- warn("%s: kevent: bad filter %s failed with error "
- "not %s", __func__,
- bad_filter_types[i].fe_name,
- bad_filter_types[i].fe_errorname);
- close(kqueue_fd);
- cleanfifo("testfifo", reader_fd, writer_fd);
- exit(-1);
- }
- }
-
- close(kqueue_fd);
- cleanfifo("testfifo", reader_fd, writer_fd);
-}
-
static int
test_ioctl_setclearflag(int fd, int flag, const char *testname,
const char *fdname, const char *flagname)
@@ -345,7 +237,6 @@ main(int argc, char *argv[])
test_lseek();
test_truncate();
- test_kqueue();
test_ioctl();
return (0);
diff --git a/usr.bin/truss/syscalls.c b/usr.bin/truss/syscalls.c
index d927815..ccceed0 100644
--- a/usr.bin/truss/syscalls.c
+++ b/usr.bin/truss/syscalls.c
@@ -259,7 +259,7 @@ struct xlat {
static struct xlat kevent_filters[] = {
X(EVFILT_READ) X(EVFILT_WRITE) X(EVFILT_AIO) X(EVFILT_VNODE)
X(EVFILT_PROC) X(EVFILT_SIGNAL) X(EVFILT_TIMER)
- X(EVFILT_NETDEV) X(EVFILT_FS) X(EVFILT_READ) XEND
+ X(EVFILT_FS) X(EVFILT_READ) XEND
};
static struct xlat kevent_flags[] = {
OpenPOWER on IntegriCloud