Date: Tue, 18 Dec 2012 12:24:38 +0400 From: Gleb Smirnoff <glebius@FreeBSD.org> To: ae@FreeBSD.org Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r244387 - head/sys/netinet Message-ID: <20121218082438.GJ94420@FreeBSD.org> In-Reply-To: <201212180814.qBI8EGfe092798@svn.freebsd.org> References: <201212180814.qBI8EGfe092798@svn.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20121218082438.GJ94420>