freebsd-dev/share
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
..
colldef According to a proposed Norwegian standard for alphabetization of which 2008-07-30 15:37:13 +00:00
dict Correct typos containing my login name (plus one more in expr.y). 2007-02-18 19:48:59 +00:00
doc Update bmake glue for changes in 9.4.3 2008-12-23 22:51:10 +00:00
examples Fix broken URL and use the same base directory as the 2009-01-13 12:47:59 +00:00
info
man Sometimes, depending on the bpf filter rules used in $PATTERN, 2009-01-30 19:33:04 +00:00
me
misc Correct description for the Marvell 88SE6101. 2009-01-10 16:24:58 +00:00
mk Document that with r186854 we started using KMODOWN/KMODGRP 2009-01-08 12:22:37 +00:00
mklocale "NONE" -> "ASCII" encoding 2008-01-23 04:25:10 +00:00
monetdef International code for Russian Ruble is changed from RUR to RUB 2007-02-28 16:28:49 +00:00
msgdef Update korean locale messages: 2008-02-01 20:15:21 +00:00
numericdef Add locales for nb_NO and nn_NO. 2006-11-09 18:10:34 +00:00
security
sendmail Dont install .svn metadata with the sendmail install. 2008-05-31 19:15:15 +00:00
skel Remove /usr/X11R6 from the path here too. 2007-05-29 22:07:57 +00:00
snmp Define a base OID for the FreeBSD version as returned in sysObjectID 2006-10-31 10:09:10 +00:00
syscons Add the nordic keyboard layout for Asus eee devices. 2008-10-17 14:07:39 +00:00
tabset
termcap - Remove kH and *6 from xterm. They are defined to the same key as @7 (kp_end). 2008-01-08 16:00:24 +00:00
timedef In the previous commit, no_NO should have been replaced with nb_NO in the 2008-07-29 11:32:42 +00:00
zoneinfo MFV of tzdata2009a 2009-01-22 11:24:42 +00:00
Makefile Whitespace nit 2008-10-08 13:20:02 +00:00
Makefile.inc