From owner-svn-src-all@FreeBSD.ORG Thu Jul 8 13:07:40 2010 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 BE238106564A; Thu, 8 Jul 2010 13:07:40 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ADF8B8FC0A; Thu, 8 Jul 2010 13:07:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o68D7eXF019002; Thu, 8 Jul 2010 13:07:40 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o68D7e0G019001; Thu, 8 Jul 2010 13:07:40 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201007081307.o68D7e0G019001@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 8 Jul 2010 13:07:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209797 - head/sys/netinet/ipfw 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: Thu, 08 Jul 2010 13:07:40 -0000 Author: glebius Date: Thu Jul 8 13:07:40 2010 New Revision: 209797 URL: http://svn.freebsd.org/changeset/base/209797 Log: Since r209216 bpf(4) searches for mbuf_tags(9) and thus will not work with a stub m_hdr instead of a full mbuf. PR: kern/148050 Modified: head/sys/netinet/ipfw/ip_fw_log.c Modified: head/sys/netinet/ipfw/ip_fw_log.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw_log.c Thu Jul 8 12:21:25 2010 (r209796) +++ head/sys/netinet/ipfw/ip_fw_log.c Thu Jul 8 13:07:40 2010 (r209797) @@ -152,22 +152,24 @@ ipfw_log(struct ip_fw *f, u_int hlen, st if (V_fw_verbose == 0) { #ifndef WITHOUT_BPF - struct m_hdr mh; + struct mbuf m0; if (log_if == NULL || log_if->if_bpf == NULL) return; + /* BPF treats the "mbuf" as read-only */ - mh.mh_next = m; - mh.mh_len = ETHER_HDR_LEN; + bzero(&m0, sizeof(struct mbuf)); + m0.m_hdr.mh_next = m; + m0.m_hdr.mh_len = ETHER_HDR_LEN; if (args->eh) { /* layer2, use orig hdr */ - mh.mh_data = (char *)args->eh; + m0.m_hdr.mh_data = (char *)args->eh; } else { /* add fake header. Later we will store * more info in the header */ - mh.mh_data = "DDDDDDSSSSSS\x08\x00"; + m0.m_hdr.mh_data = "DDDDDDSSSSSS\x08\x00"; } - BPF_MTAP(log_if, (struct mbuf *)&mh); + BPF_MTAP(log_if, &m0); #endif /* !WITHOUT_BPF */ return; }