From owner-svn-src-all@FreeBSD.ORG Tue Jul 12 01:16:44 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 218D8106566C; Tue, 12 Jul 2011 01:16:44 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 119358FC08; Tue, 12 Jul 2011 01:16:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6C1GhG8016646; Tue, 12 Jul 2011 01:16:43 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6C1GhTN016644; Tue, 12 Jul 2011 01:16:43 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201107120116.p6C1GhTN016644@svn.freebsd.org> From: Xin LI Date: Tue, 12 Jul 2011 01:16:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223941 - stable/8/contrib/libpcap/bpf/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jul 2011 01:16:44 -0000 Author: delphij Date: Tue Jul 12 01:16:43 2011 New Revision: 223941 URL: http://svn.freebsd.org/changeset/base/223941 Log: MFC r223616: Incorporate vendor commit ecdc5c0a7f7591a7cd4a: In userland, sign extend the offset for JA instructions. We currently use that to implement "ip6 protochain", and "pc" might be wider than "pc->k", in which case we need to arrange that "pc->k" be sign-extended, by casting it to bpf_int32. PR: kern/157188 Submitted by: plosher Modified: stable/8/contrib/libpcap/bpf/net/bpf_filter.c Directory Properties: stable/8/contrib/libpcap/ (props changed) Modified: stable/8/contrib/libpcap/bpf/net/bpf_filter.c ============================================================================== --- stable/8/contrib/libpcap/bpf/net/bpf_filter.c Tue Jul 12 00:31:11 2011 (r223940) +++ stable/8/contrib/libpcap/bpf/net/bpf_filter.c Tue Jul 12 01:16:43 2011 (r223941) @@ -396,7 +396,18 @@ bpf_filter(pc, p, wirelen, buflen) continue; case BPF_JMP|BPF_JA: +#if defined(KERNEL) || defined(_KERNEL) + /* + * No backward jumps allowed. + */ pc += pc->k; +#else + /* + * XXX - we currently implement "ip6 protochain" + * with backward jumps, so sign-extend pc->k. + */ + pc += (bpf_int32)pc->k; +#endif continue; case BPF_JMP|BPF_JGT|BPF_K: