freebsd-dev/share/man
Giorgos Keramidas 7e7c1896a0 Sometimes, depending on the bpf filter rules used in $PATTERN,
the example script of the manpage feeds awk(1) with values larger
than UINT32_MAX.  Then awk prints a negative value, and this
messes up $BPFPROG.  Trying to load the resulting bpf byte codes
with ngctl then fails.

For example, the output for PATTERN="udp and dst net 255.255.0.0/16"
should be (all in one line):

    bpf_prog_len=10
    bpf_prog=[
      { code=40 jt=0 jf=0 k=12 }
      { code=21 jt=7 jf=0 k=34525 }
      { code=21 jt=0 jf=6 k=2048 }
      { code=48 jt=0 jf=0 k=23 }
      { code=21 jt=0 jf=4 k=17 }
      { code=32 jt=0 jf=0 k=30 }
      { code=84 jt=0 jf=0 k=4294901760 }
      { code=21 jt=0 jf=1 k=4294901760 }
      { code=6 jt=0 jf=0 k=8192 }
      { code=6 jt=0 jf=0 k=0 }
    ]

The two k=4294901760 values are displayed as k=-2147483648 by awk.

Replace the awk script of the manpage example with a slower but
safer version, that doesn't really attempt to convert the byte
code printed by tcpdump from string to number and back.

PR:		docs/123255
Submitted by:	Eugenio Maffione, eugenio.maffione at telecomitalia.it
MFC after:	3 days
2009-01-30 19:33:04 +00:00
..
man1 Fix markup. 2006-12-26 22:25:58 +00:00
man3 Small typo in the makedev(3) manpage. 2008-09-28 20:26:16 +00:00
man4 Sometimes, depending on the bpf filter rules used in $PATTERN, 2009-01-30 19:33:04 +00:00
man5 Backout change 187782. It inhibits ntpd from starting at all 2009-01-29 06:43:29 +00:00
man6 - We don't install USD docs for games anymore since the games with docs 2005-11-29 17:11:09 +00:00
man7 - Rename adding_user(8) to adding_user(7). There's no adding_user utility, 2009-01-30 15:14:58 +00:00
man8 - Rename adding_user(8) to adding_user(7). There's no adding_user utility, 2009-01-30 15:14:58 +00:00
man9 Add ENOMEM to the return values. 2009-01-27 00:22:16 +00:00
Makefile Reimplementation of world/kernel build options. For details, see: 2006-03-17 18:54:44 +00:00