Accept more types of FD Taps in #ip
authorBarret Rhoden <brho@cs.berkeley.edu>
Mon, 26 Oct 2015 19:16:05 +0000 (15:16 -0400)
committerBarret Rhoden <brho@cs.berkeley.edu>
Wed, 28 Oct 2015 16:05:14 +0000 (12:05 -0400)
As discussed in commit cfb02bd7818d ("Accept more types of FD Taps in
 #eventfd"), we need to allow some "unimportant" taps, such as PRIORITY
and ERROR.  #ip currently will not trigger any events for these, since
they do not occur in the networking stack (yet), but the user can at
least ask for them.

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
kern/src/net/devip.c

index 40d0b2d..3a73943 100644 (file)
@@ -1355,7 +1355,8 @@ int iptapfd(struct chan *chan, struct fd_tap *tap, int cmd)
        int ret;
 
        #define DEVIP_LEGAL_DATA_TAPS (FDTAP_FILT_READABLE | FDTAP_FILT_WRITABLE | \
-                                      FDTAP_FILT_HANGUP)
+                                      FDTAP_FILT_HANGUP | FDTAP_FILT_PRIORITY |   \
+                                      FDTAP_FILT_ERROR)
        #define DEVIP_LEGAL_LISTEN_TAPS (FDTAP_FILT_READABLE | FDTAP_FILT_HANGUP)
 
        /* That's a lot of pointers to get to the conv! */
@@ -1367,8 +1368,8 @@ int iptapfd(struct chan *chan, struct fd_tap *tap, int cmd)
                case Qdata:
                        if (tap->filter & ~DEVIP_LEGAL_DATA_TAPS) {
                                set_errno(ENOSYS);
-                               set_errstr("Unsupported #%s data tap, must be %p", devname(),
-                                          DEVIP_LEGAL_DATA_TAPS);
+                               set_errstr("Unsupported #%s data tap %p, must be %p", devname(),
+                                          tap->filter, DEVIP_LEGAL_DATA_TAPS);
                                return -1;
                        }
                        spin_lock(&conv->tap_lock);
@@ -1400,8 +1401,8 @@ int iptapfd(struct chan *chan, struct fd_tap *tap, int cmd)
                case Qlisten:
                        if (tap->filter & ~DEVIP_LEGAL_LISTEN_TAPS) {
                                set_errno(ENOSYS);
-                               set_errstr("Unsupported #%s listen tap, must be %p", devname(),
-                                          DEVIP_LEGAL_LISTEN_TAPS);
+                               set_errstr("Unsupported #%s listen tap %p, must be %p",
+                                          devname(), tap->filter, DEVIP_LEGAL_LISTEN_TAPS);
                                return -1;
                        }
                        spin_lock(&conv->tap_lock);