From owner-freebsd-arch Wed Oct 16 11:29:55 2002 Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E9E5337B404; Wed, 16 Oct 2002 11:29:53 -0700 (PDT) Received: from ebb.errno.com (ebb.errno.com [66.127.85.87]) by mx1.FreeBSD.org (Postfix) with ESMTP id 500B943EE8; Wed, 16 Oct 2002 11:29:29 -0700 (PDT) (envelope-from sam@errno.com) Received: from melange (melange.errno.com [66.127.85.82]) (authenticated bits=0) by ebb.errno.com (8.12.5/8.12.1) with ESMTP id g9GITP1H005622 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO); Wed, 16 Oct 2002 11:29:26 -0700 (PDT)?g (envelope-from sam@errno.com)œ X-Authentication-Warning: ebb.errno.com: Host melange.errno.com [66.127.85.82] claimed to be melange Message-ID: <24db01c27541$f529da40$52557f42@errno.com> From: "Sam Leffler" To: "JINMEI Tatuya" , "Luigi Rizzo" Cc: , , "Julian Elischer" References: <18d301c26e5e$8b5c7a30$52557f42@errno.com> <080101c27151$b2e92a30$52557f42@errno.com> <20021016074610.C34626@carp.icir.org> <20021016111857.A38181@carp.icir.org> Subject: Re: CFR: m_tag patch Date: Wed, 16 Oct 2002 11:29:25 -0700 Organization: Errno Consulting MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > On Thu, Oct 17, 2002 at 03:07:07AM +0900, JINMEI Tatuya / ?$B?@L@C#:H?(B wrote: > ... > > (I re-read the thread) perhaps the example in my previous message > > wasn't good (and it was at least incorrect). According to the > > discussion on the thread, we'll probably keep m_tag_cookie being 0 and > > use m_tag_id in (e.g.) ip6_output.c. So, we'll be happy if this > > convention is kept (and will be kept) at least under netinet6. > > unfortunately this will not prevent code from having to check that > the m_tag_cookie actually corresponds to the value you want, to > make sure that your code does not misinterpret as own tags > generated/destined to other clients. > > Am I correct, Sam ? > Correct. If you explicitly look inside the m_tag structure instead of using one of the m_tag_* routines to search then you will need to validate m_tag_cookie to avoid interpreting tags created by other modules. The comments I wrote in mbuf.h for this stuff describe this and say that when writing code that is to be compatible with other systems one should always use MTAG_ABI_COMPAT and the openbsd-compatible m_tag_get and m_tag_find routines. m_tag_cookie was mainly added so that netgraph could piggyback on top of the facility and remove it's private code. At some point it may be worthwhile to talk with the openbsd+netbsd folks about adopting this new m_tag facility. Sam To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message