From owner-p4-projects@FreeBSD.ORG Mon Aug 4 18:48:27 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 752001065676; Mon, 4 Aug 2008 18:48:27 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 38FAF1065673 for ; Mon, 4 Aug 2008 18:48:27 +0000 (UTC) (envelope-from gk@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 1EE8C8FC13 for ; Mon, 4 Aug 2008 18:48:27 +0000 (UTC) (envelope-from gk@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.2/8.14.2) with ESMTP id m74ImRws029151 for ; Mon, 4 Aug 2008 18:48:27 GMT (envelope-from gk@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.2/8.14.1/Submit) id m74ImQIw029149 for perforce@freebsd.org; Mon, 4 Aug 2008 18:48:26 GMT (envelope-from gk@FreeBSD.org) Date: Mon, 4 Aug 2008 18:48:26 GMT Message-Id: <200808041848.m74ImQIw029149@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to gk@FreeBSD.org using -f From: Gleb Kurtsou To: Perforce Change Reviews Cc: Subject: PERFORCE change 146645 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2008 18:48:27 -0000 http://perforce.freebsd.org/chv.cgi?CH=146645 Change 146645 by gk@gk_h1 on 2008/08/04 18:48:05 no functional changes. do not mention args->L3offset document that args->m contains layer2 header when invoked from ether_* Affected files ... .. //depot/projects/soc2008/gk_l2filter/sys-netinet/ip_fw2.c#14 edit Differences ... ==== //depot/projects/soc2008/gk_l2filter/sys-netinet/ip_fw2.c#14 (text+ko) ==== @@ -752,18 +752,6 @@ */ tcp_respond(NULL, ip6, tcp, m, ack, seq, flags); } else if (code != ICMP6_UNREACH_RST) { /* Send an ICMPv6 unreach. */ -#if 0 - /* - * Unlike above, the mbufs need to line up with the ip6 hdr, - * as the contents are read. We need to m_adj() the - * needed amount. - * The mbuf will however be thrown away so we can adjust it. - * Remember we did an m_pullup on it already so we - * can make some assumptions about contiguousness. - */ - if (args->L3offset) - m_adj(m, args->L3offset); -#endif icmp6_error(m, ICMP6_DST_UNREACH, code, 0); } else m_freem(m); @@ -1732,16 +1720,6 @@ send_reject(struct ip_fw_args *args, int code, int ip_len, struct ip *ip) { -#if 0 - /* XXX When ip is not guaranteed to be at mtod() we will - * need to account for this */ - * The mbuf will however be thrown away so we can adjust it. - * Remember we did an m_pullup on it already so we - * can make some assumptions about contiguousness. - */ - if (args->L3offset) - m_adj(m, args->L3offset); -#endif if (code != ICMP_REJECT_RST) { /* Send an ICMP unreach */ icmp_error(args->m, ICMP_UNREACH, code, 0L, 0); } else if (args->f_id.proto == IPPROTO_TCP) { @@ -2112,10 +2090,9 @@ * Parameters: * * args->m (in/out) The packet; we set to NULL when/if we nuke it. - * Starts with the IP header. + * Starts with the IP header or with layer2 header if IP_FW_ARGS_LAYER2 + * is set in args->flags. * args->eh (in) ethernet header if present, or NULL for layer3 packet. - * args->L3offset Number of bytes bypassed if we came from L2. - * e.g. often sizeof(eh) ** NOTYET ** * args->oif Outgoing interface, or NULL if packet is incoming. * The incoming interface is in the mbuf. (in) * args->divert_rule (in/out) @@ -2126,6 +2103,7 @@ * args->next_hop Socket we are forwarding to (out). * args->f_id Addresses grabbed from the packet (out) * args->cookie a cookie depending on rule action + * args->flags Flags * * Return value: * @@ -2151,8 +2129,6 @@ * * args->eh The ethernet header. It is non-null for a layer2 * packet, it is NULL for a layer-3 packet. - * **notyet** - * args->L3offset Offset in the packet to the L3 (IP or equiv.) header. * * m | args->m Pointer to the mbuf, as received from the caller. * It may change if ipfw_chk() does an m_pullup, or if it @@ -2160,8 +2136,6 @@ * XXX This has to change, so that ipfw_chk() never modifies * or consumes the buffer. * ip is the beginning of the ip(4 or 6) header. - * Calculated by adding the L3offset to the start of data. - * (Until we start using L3offset, the packet is * supposed to start with the ip header). */ struct mbuf *m = args->m;