From owner-freebsd-net@FreeBSD.ORG Tue Jan 18 02:23:40 2011 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 8EF51106566B for ; Tue, 18 Jan 2011 02:23:40 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-pv0-f182.google.com (mail-pv0-f182.google.com [74.125.83.182]) by mx1.freebsd.org (Postfix) with ESMTP id 4F8328FC15 for ; Tue, 18 Jan 2011 02:23:39 +0000 (UTC) Received: by pvc22 with SMTP id 22so1061796pvc.13 for ; Mon, 17 Jan 2011 18:23:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:date:to:cc:subject:message-id:reply-to :references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=C6bIFY/cS3IWvzVejgrIESwhg4ZqrANNnB2E2Bmn6dw=; b=xTa5Sa/niG0RZCXAuR9tgDopZGnSmWsLNqMmDJH5hFdKMcU8T66eE2xn8ZwbWkB2wr zEMZifiygVo9LkPKD6yaL75Yb2PiAu8c8uTHJjTL71XMBgnbOOd4YWx0cV9xglXuv0rD kD9ai7BaysI/rsmjOdKeAnJrRaLuczb2YxkHY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=LkTyYfOu/bIRj7bT1jTGeymU9Df3D2cGCvjEwQrCDFRjjoP6IUg/WmMtCxvy7XLNxg tx8/O4vELoWvi9DYJkmfpdpbPnQAClYAETEToqssjBF4jdrRZovbePQpv8pUDxogA/eK SY+mHREEN+CJvied/E6CTRw11WWmEA7rdmK4Q= Received: by 10.142.170.11 with SMTP id s11mr4502479wfe.448.1295317419564; Mon, 17 Jan 2011 18:23:39 -0800 (PST) Received: from pyunyh@gmail.com ([174.35.1.224]) by mx.google.com with ESMTPS id e14sm7373273wfg.8.2011.01.17.18.23.37 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 17 Jan 2011 18:23:38 -0800 (PST) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Mon, 17 Jan 2011 18:22:46 -0800 From: Pyun YongHyeon Date: Mon, 17 Jan 2011 18:22:46 -0800 To: Adrian Chadd Message-ID: <20110118022246.GE1210@michelle.cdnetworks.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Cc: Monthadar Al Jaberi , freebsd-net@freebsd.org, "Jayachandran C." , freebsd-mips@freebsd.org Subject: Re: capturing packet from wlan0 with netgraph? X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2011 02:23:40 -0000 On Tue, Jan 18, 2011 at 09:55:01AM +0800, Adrian Chadd wrote: > On 18 January 2011 02:03, Monthadar Al Jaberi wrote: > > filed a PR http://www.freebsd.org/cgi/query-pr.cgi?pr=154091 > > Thanks. > > Network-stack and MIPS guys - what's the best way to handle this kind > of stuff? This isn't the first time I've come across weird alignment > stuff in the network stack that just doesn't seem to get much > attention. Is it perhaps worth adding some debugging macros that > account/log unaligned-ness? So people playing at home on i386/amd64 > can play along? > I guess one of device driver/part of network stack is not aligning IP header on strict-alignment architecture. But I'm pretty sure all wired drivers always align IP header on 32bit boundary no matter how it costs on strict alignment architectures. But it does not align it on non-strict alignment architectures since that costs too much without reasonable benefit. I think you can add m_copyup() at the beginning ip_input to proceed processing and print back traces to track down which one generated unaligned IP header. > > > Adrian