From owner-freebsd-net@FreeBSD.ORG Thu Feb 2 06:53:48 2012 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F083C1065675 for ; Thu, 2 Feb 2012 06:53:48 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: from mail-qy0-f182.google.com (mail-qy0-f182.google.com [209.85.216.182]) by mx1.freebsd.org (Postfix) with ESMTP id AF2508FC21 for ; Thu, 2 Feb 2012 06:53:48 +0000 (UTC) Received: by qcmt40 with SMTP id t40so1649036qcm.13 for ; Wed, 01 Feb 2012 22:53:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=EVpvmCW21ZFp6BmpZJQzQB8hNGh+D5xLzEBxkVR4fls=; b=K/cYqki3M9KcCcczNa00UQ65OzlqTX+aQrZgUhOdwWyKPx7EkHe73ybw1fgLYpSfFL 61QUaNcwiN1DzT4Kccg0/S/y3IzEJSgByj2lOmPC4qlTmsivA1bEyInIJQfWroGifu9d QdekyHdI8jQSlaoyJHII6H5vlY0rfQ0mBocE0= MIME-Version: 1.0 Received: by 10.224.10.19 with SMTP id n19mr2144338qan.68.1328165628060; Wed, 01 Feb 2012 22:53:48 -0800 (PST) Received: by 10.229.222.202 with HTTP; Wed, 1 Feb 2012 22:53:48 -0800 (PST) In-Reply-To: <4f298d95.82b7cc0a.49b2.5d24@mx.google.com> References: <4f298d95.82b7cc0a.49b2.5d24@mx.google.com> Date: Wed, 1 Feb 2012 22:53:48 -0800 Message-ID: From: Navdeep Parhar To: Rozhuk.IM@gmail.com Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-net@freebsd.org Subject: Re: m_pullup - fail X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2012 06:53:49 -0000 On Wed, Feb 1, 2012 at 11:07 AM, wrote: > Hello! > > > The function always returns an error and remove the chain MBUF for two or > more generated on the same host. > If the pre-call m_defrag no error occurs. > This is normal behavior? > How to know in advance the maximum size for MBUF that does not cause a > failure in m_pullup? You can't pullup more than MHLEN bytes into a pkthdr mbuf if it's not associated with an external cluster. See the last sentence in this excerpt from mbuf(9): m_pullup(mbuf, len) Arrange that the first len bytes of an mbuf chain are contiguous and lay in the data area of mbuf, so they are accessible with mtod(mbuf, type). It is important to remember that this may involve reallocating some mbufs and moving data so all pointers referencing data within the old mbuf chain must be recalculated or made invalid. Return the new mbuf chain on success, NULL on fail- ure (the mbuf chain is freed in this case). Note: It does not allocate any mbuf clusters, so len must be less than MHLEN. Regards, Navdeep > > > mbuf: 0xfffffe0074fc0600 len: 42, next: 0xfffffe0073a45800, 2 > mbuf: 0xfffffe0073a45800 len: 210, next: 0, 1 > FAIL: m_pullup: m_pkthdr.len = 252, m_len = 42, pullup_len = 252 > > > > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"