From owner-freebsd-mips@FreeBSD.ORG Mon Jan 17 18:03:29 2011 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3DF9E106564A; Mon, 17 Jan 2011 18:03:29 +0000 (UTC) (envelope-from monthadar@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 675048FC08; Mon, 17 Jan 2011 18:03:28 +0000 (UTC) Received: by fxm16 with SMTP id 16so6403192fxm.13 for ; Mon, 17 Jan 2011 10:03:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=bHxJpu//BkemyQu0RMvYPzRx25S6NAXkSlgwwadwZ2E=; b=hpHLPpZ+mSDpiBLtBFQl92djTiEiV7BBCM3PHvkmD85PwQhTCotSBmD1pmFfItY0sm UiO84JHz/gCSkwLlYP9x1MJdZi2JD8JVhy1EUa9ED3TpHmTtN7hmbWthwguCVI51pg3N vIdz8jJsSpDrJ/jyxPgAonumUXZZeOTGy3+/Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=b/pd4A1/fi6GICX3BGjnuwzkgWb6f2FjzrQiCliidI///j5g0I3Tdh020RmKuRcflO So12/FHYgFfyszQZ3R1SmdcCFU0RhB+QERInpOp6VfKoxRLotEg4dHkD3iKKk7tGSn/e yb0iaAxaSYueqs55nnciRHXEthmiFYj2srzwA= MIME-Version: 1.0 Received: by 10.223.85.204 with SMTP id p12mr5025179fal.146.1295287407133; Mon, 17 Jan 2011 10:03:27 -0800 (PST) Received: by 10.223.85.198 with HTTP; Mon, 17 Jan 2011 10:03:27 -0800 (PST) In-Reply-To: References: Date: Mon, 17 Jan 2011 19:03:27 +0100 Message-ID: From: Monthadar Al Jaberi To: Adrian Chadd Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-net@freebsd.org, freebsd-mips@freebsd.org Subject: Re: capturing packet from wlan0 with netgraph? X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jan 2011 18:03:29 -0000 filed a PR http://www.freebsd.org/cgi/query-pr.cgi?pr=3D154091 On Mon, Jan 17, 2011 at 6:43 AM, Adrian Chadd wrote: > Hi, > > Please file a PR about this and the output of "show registers". > > I bet that the ip pointer isn't aligned at that point in the code. > Whatever is passing the packet to the IP layer should be re-aligning > things beforehand. > (eg, look at what the ethernet ipfw hook code does - if the ether type > is ipv4/ipv6, it actually realigns the packets before passing it back > up the stack.) > > > > Adrian > > On 13 January 2011 16:25, Monthadar Al Jaberi wrote= : >> sorry but I have not worked with this for a while now, After some >> thoughts I dont think using netgraph will do me any good, because >> traffic can still flow through the antennas of the cards. >> >> If you think it would still be useful to see more ddb prompt for other >> scenarios I am happy to try and supply that, but I won't have some >> free time until late tomorrow :) >> >> thnx again! >> >> On Thu, Jan 13, 2011 at 7:53 AM, Adrian Chadd wrote= : >>> I've encountered this before. >>> >>> The mbuf's there aren't always aligned at this point. >>> >>> >>> >>> Adrian >>> >>> On 13 January 2011 14:17, Jayachandran C. wr= ote: >>>> On Thu, Jan 13, 2011 at 11:08 AM, Adrian Chadd wr= ote: >>>>> Find out what the address is that's causing the problem. There's >>>>> plenty of places where unaligned mbuf's exist in the IP code and >>>>> aren't correctly realigned before being touched. >>>>> >>>>> MIPS people - is "address error" an alignment problem? >>>> >>>> Address error can be an alignment problem (or some other cases like >>>> accessing kernel address from userspace). >>>> >>>> But looking at the crash, it certainly seems like in ip_input, the lin= e >>>> =A0 =A0 435 =A0 =A0 =A0 =A0 if (ip->ip_v !=3D IPVERSION) { >>>> >>>> got a bad address for the ip pointer. >>>> >>>> The output of 'show registers' at the ddb prompt would be useful to >>>> debug further. >>>> >>>> >>>>> On 30 December 2010 21:47, Monthadar Al Jaberi = wrote: >>>>>> Hi, >>>>>> >>>>>> I have an idea in my head and would like to know if it is possible. >>>>>> >>>>>> I want to simulate and test the net80211 mesh code in FreeBSD Curren= t. >>>>>> I have an RSPRO board with 3 atheros cards. >>>>>> >>>>>> My =A0basic idea is to run three jails each having its own network >>>>>> stack, and redirect all data packets coming out/in of the wlan drive= r >>>>>> to a Server running a home brew application that simulates the mediu= m. >>>>>> That would be great, right? Realtime unchanged code to test, running >>>>>> different application in their own jails. >>>>>> >>>>>> So first I started to test netgraph with a simple test case, I want = to >>>>>> receive all packets from one wireless card and see the data in >>>>>> wireshark or tcpdump... >>>>>> >>>>>> This is my netgraph code: >>>>>> mkpeer wlan0: hub lower hook0 >>>>>> name wlan0:lower hub >>>>>> connect hub: wlan0: hook1 upper >>>>>> connect hub: arge0: hook2 lower >>>>>> >>>>>> >>>>>> So if I understood man ng_ether correct, this should capture >>>>>> everything from wlan and redirect to ethernet cable. >>>>>> >>>>>> But I get a panic after a couple of seconds: >>>>>> Trap cause =3D 4 (address error (load or I-fetch) - kernel mode) >>>>>> [ thread pid 11 tid 100037 ] >>>>>> Stopped at =A0 =A0 =A0ip_input+0xd8: =A0lw =A0 =A0 =A0v0,0(s0) >>>>>> >>>>>> I suspect that data flows to all hooks of the hub, and that is a bad >>>>>> thing right? Need to create a special hub node to filter data? Or >>>>>> maybe use two ethernet cables for out resp. in? >>>>>> >>>>>> Is it even possible to do what I want? Or am I thinking wrong? And i= s >>>>>> there a simpler way? >>>>>> >>>>>> What I want is to test mesh code in a bunch of FreeBSD systems witho= ut >>>>>> moving the hardware, one could just stack RSPROs and connected them = a >>>>>> big switch and a PC. >>>>>> Hope was I clear in my thoughts. >>>>>> >>>>>> Best regards, >>>>>> -- >>>>>> //Monthadar Al Jaberi >>>> >>>> JC. >>>> >>> >> >> >> >> -- >> //Monthadar Al Jaberi >> > --=20 //Monthadar Al Jaberi