From owner-cvs-src-old@FreeBSD.ORG Fri Jan 30 19:33:24 2009 Return-Path: Delivered-To: cvs-src-old@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76D5510656D0 for ; Fri, 30 Jan 2009 19:33:24 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 60D218FC22 for ; Fri, 30 Jan 2009 19:33:24 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n0UJXOnn027312 for ; Fri, 30 Jan 2009 19:33:24 GMT (envelope-from keramida@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n0UJXOaa027311 for cvs-src-old@freebsd.org; Fri, 30 Jan 2009 19:33:24 GMT (envelope-from keramida@repoman.freebsd.org) Message-Id: <200901301933.n0UJXOaa027311@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to keramida@repoman.freebsd.org using -f From: Giorgos Keramidas Date: Fri, 30 Jan 2009 19:33:04 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/share/man/man4 ng_bpf.4 X-BeenThere: cvs-src-old@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Jan 2009 19:33:27 -0000 keramida 2009-01-30 19:33:04 UTC FreeBSD src repository Modified files: share/man/man4 ng_bpf.4 Log: SVN rev 187935 on 2009-01-30 19:33:04Z by keramida 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 Revision Changes Path 1.23 +8 -15 src/share/man/man4/ng_bpf.4