Bug 131918 - [patch] Fixes for the BPF(4) man page
Summary: [patch] Fixes for the BPF(4) man page
Status: In Progress
Alias: None
Product: Documentation
Classification: Unclassified
Component: Manual Pages (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Gordon Bergling
Keywords: patch
Depends on:
Reported: 2009-02-20 23:40 UTC by guy
Modified: 2020-10-09 15:51 UTC (History)
2 users (show)

See Also:

file.diff (11.40 KB, patch)
2009-02-20 23:40 UTC, guy
no flags Details | Diff
bpf.4.patch (11.64 KB, patch)
2009-02-21 03:31 UTC, guy
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description guy 2009-02-20 23:40:00 UTC
The BPF(4) man page:

    still implies that you have separate /dev/bpfN devices in one place;

    still says only Ethernet, SLIP, and PPP are supported, and that no network types with variable-length headers (such as 802.11) are supported;

    says that EIO, not EINVAL, is returned if you do a read() with a buffer size other than the one specified with BIOCSBLEN;

    has some stylistic glitches;


    doesn't document the standard ioctls that apply to a BPF device;

    says the bf_len field of a "struct bpf_program" and the "k" field of a BPF instruction are signed;

    says the "k" field of a BPF instruction, and the bh_caplen and bh_datalen fields of the BPF per-packet header, are u_long, rather than bpf_u_int32.

Fix: Patch attached with submission follows:
Comment 1 guy 2009-02-21 03:31:03 UTC
While we're at it, we might as well remove

	Since packet data is in network byte order, applications should use  
the byteorder(3) macros to extract multi-byte values.

because, in fact, not all packet data *is* in network byte order (SMB  
fields, for example, are little-endian).

I've attached an updated patch.
Comment 2 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 08:00:27 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped
Comment 3 commit-hook freebsd_committer 2020-10-09 15:51:12 UTC
A commit references this bug:

Author: gbe
Date: Fri Oct  9 15:50:50 UTC 2020
New revision: 366580
URL: https://svnweb.freebsd.org/changeset/base/366580

  bpf(4): Update the man page to reflect reality

  PR:		131918
  Submitted by:	guy at alum dot mit dot edu
  Reviewed by:	gnn, gbe
  Approved by:	gnn
  MFC after:	2 weeks
  Differential Revision:	https://reviews.freebsd.org/D25993