Re: bpf/pcap are weird

From: Bruce Evans (bde_at_zeta.org.au)
Date: 11/06/03

  • Next message: Tim Robbins: "Re: >0x7fffffff blocksize filesystem reporting"
    Date: Thu, 6 Nov 2003 16:30:22 +1100 (EST)
    To: Brian Fundakowski Feldman <green@freebsd.org>
    
    

    On Wed, 5 Nov 2003, Brian Fundakowski Feldman wrote:

    > Okay, this is goofy stuff and breaks a lot of code that otherwise makes
    > certain assumptions about pcap/bpf that don't work on FreeBSD. Our bpf(4)
    > doesn't actually care about the non-blocking fd flag, and our pcap(3)
    > doesn't care at all about BIOCIMMEDIATE. Why do we have BIOCIMMEDIATE? It
    > seems like it's what SHOULD be implemented with the non-blocking I/O flag
    > with the exception that if using O_NONBLOCK/FIONBIO you could actually query
    > for the status, whereas you can't query for BIOCIMMEDIATE since it's only a
    > SET and not a GET ioctl.

    Er, FreeBSD's bpf certainly cares about the non-blocking fd flag. It uses
    it in bpfread() although not in any other device switch function:

                    if (ioflag & IO_NDELAY) {
                            BPFD_UNLOCK(d);
                            return (EWOULDBLOCK);
                    }

    NetBSD still seems to use the old 4.4 code which ignores the non-blocking
    fd flag in bpfread() and doesn't even use a dedicated non-blocking device
    flag (it overloads the timeout).

    bpfpoll() is reported to be broken; see PR 36219. Rev.1.113 of bpf.c
    may have disturbed this. It removed the comment which said that
    bpf_ready() doesn't acually imitate resultof(FIONREAD) != 0.

    I don't know anything about BIOCIMMEDIATE.

    Bruce
    _______________________________________________
    freebsd-arch@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-arch
    To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org"


  • Next message: Tim Robbins: "Re: >0x7fffffff blocksize filesystem reporting"

    Relevant Pages

    • bpf/pcap are weird
      ... Why do we have BIOCIMMEDIATE? ... seems like it's what SHOULD be implemented with the non-blocking I/O flag ... FreeBSD can't put the interface in the mode it wants to, ...
      (freebsd-arch)
    • Re: Skiing behind a 2 person boat. Legal?
      ... >>> So you have to raise a flag when your skier falls in the course. ... Not that you really care ... according to the San Jaoquin County and Contra Costa County Sherriffs ...
      (rec.sport.waterski)
    • Re: The South Pole Telescope
      ... whining Republicant-get-dones never took care of: ... An amendment to protect the flag; ...
      (rec.radio.amateur.antenna)
    • Re: Upgrading Hard Drives
      ... AFAIK grub doesn't care about the boot flag (DOS and Windows 9x used to ... Will that preserve all the special files? ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
      (Debian-User)
    • Re: Upgrading Hard Drives
      ... AFAIK grub doesn't care about the boot flag (DOS and Windows 9x used to ... Will that preserve all the special files? ... actually on disk, not the ones created dynamically by e.g. udev. ...
      (Debian-User)

  • Quantcast