From owner-svn-src-all@FreeBSD.ORG Tue Dec 18 08:24:39 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BF91F67F; Tue, 18 Dec 2012 08:24:39 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) by mx1.freebsd.org (Postfix) with ESMTP id 3D37E8FC0C; Tue, 18 Dec 2012 08:24:39 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id qBI8Ocau062026; Tue, 18 Dec 2012 12:24:38 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id qBI8Oc3S062025; Tue, 18 Dec 2012 12:24:38 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 18 Dec 2012 12:24:38 +0400 From: Gleb Smirnoff To: ae@FreeBSD.org Subject: Re: svn commit: r244387 - head/sys/netinet Message-ID: <20121218082438.GJ94420@FreeBSD.org> References: <201212180814.qBI8EGfe092798@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <201212180814.qBI8EGfe092798@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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, 18 Dec 2012 08:24:39 -0000 Andrey, On Tue, Dec 18, 2012 at 08:14:16AM +0000, Gleb Smirnoff wrote: T> Author: glebius T> Date: Tue Dec 18 08:14:16 2012 T> New Revision: 244387 T> URL: http://svnweb.freebsd.org/changeset/base/244387 T> T> Log: T> Fix !INET6 build after r244365. T> T> Modified: T> head/sys/netinet/tcp_input.c T> At review stage of the r242079 I have noted, that more effort should be put into mbuf flags prior to this change: - cleanse deprecated mbuf flags (at least M_FREELIST) - move 90% of mbuf flags to pkthdr flags - not utilize protocol specific flag, but use a global one to mark packet as having forward tag Several of the fallouts from r242079 could be avoided. IMHO, if anyone is hacking on a new feature or optimisation and encounters a "bad code" (tm), he/she should remove the bad code from his/her way and not leave it to be worked on sometime later, which usually ends up in never. This approach adds more work before the feature/optimisation is commited, but reduces probability of problems after commit and thus amount of urgent work after commit. P.S. Please do not take above ranting paragraph as personal critics of yourself, this is just thinking out loud on how things should be done :) T> Modified: head/sys/netinet/tcp_input.c T> ============================================================================== T> --- head/sys/netinet/tcp_input.c Tue Dec 18 08:09:44 2012 (r244386) T> +++ head/sys/netinet/tcp_input.c Tue Dec 18 08:14:16 2012 (r244387) T> @@ -780,8 +780,17 @@ findpcb: T> /* T> * Grab info from PACKET_TAG_IPFORWARD tag prepended to the chain. T> */ T> - if ((isipv6 && (m->m_flags & M_IP6_NEXTHOP)) || T> - (!isipv6 && (m->m_flags & M_IP_NEXTHOP))) T> + if ( T> +#ifdef INET6 T> + (isipv6 && (m->m_flags & M_IP6_NEXTHOP)) T> +#ifdef INET T> + || (!isipv6 && (m->m_flags & M_IP_NEXTHOP)) T> +#endif T> +#endif T> +#if defined(INET) && !defined(INET6) T> + (m->m_flags & M_IP_NEXTHOP) T> +#endif T> + ) T> fwd_tag = m_tag_find(m, PACKET_TAG_IPFORWARD, NULL); T> T> #ifdef INET6 -- Totus tuus, Glebius.