From owner-freebsd-net@FreeBSD.ORG Wed Feb 16 20:51:45 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 B6A3E1065673; Wed, 16 Feb 2011 20:51:45 +0000 (UTC) (envelope-from monthadar@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 25A5C8FC1C; Wed, 16 Feb 2011 20:51:44 +0000 (UTC) Received: by wyf19 with SMTP id 19so1771287wyf.13 for ; Wed, 16 Feb 2011 12:51:44 -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=7EfsWcp7Ku0qxBmH9i366JZMfBN1cpfublrwZ3S5YQE=; b=RhWdIy/c1SnGAwATTVXN/kgm8ZjYoLXN2kaKlwWGmMaQwFwPFnVC4rp3AhME8UV7Ih WwvU/maTqLeb9f76Lq8Lwn6HZuyk+dzFqsCch0XbynM1Zzl2POle01MeknUQoKi0ChjP bkkxaoXys+jlMi41Lc08YzARae4GFWGjSfm64= 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=iRbMem1Is1ozu6WUJ7kLcO7k07vLgYtKM1zMr0nzt8R7PYFqG6WMht+SOxjjAAz3FM QjHqedmBbGZ7TS9M8rXiimOVtBOsPi73sUTsDx78/0r6hKtNG0Mq7d7nAsgakItVAq6W y9tUwFzvszTxJkSxJlVqNYqhULaTZ7VeHBtIk= MIME-Version: 1.0 Received: by 10.227.128.70 with SMTP id j6mr932309wbs.16.1297889503871; Wed, 16 Feb 2011 12:51:43 -0800 (PST) Received: by 10.227.69.7 with HTTP; Wed, 16 Feb 2011 12:51:43 -0800 (PST) In-Reply-To: References: Date: Wed, 16 Feb 2011 21:51:43 +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 Subject: Re: [ieee80211_hwmp][panic] hwmp_recv_prep(...) 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: Wed, 16 Feb 2011 20:51:45 -0000 I think anytime the destination node sends a PREP to the originator node that is not a peering node (not in direct contact with) we would get this panic. On Wed, Feb 16, 2011 at 8:52 PM, Adrian Chadd wrote: > Besides being a potential DoS vector (and thus panicing on anything > like that =3D=3D bad idea), what legitimate-but-broken circumstances coul= d > cause a node to hear its own announcement? > > > > Adrian > > > On 15 February 2011 07:00, Monthadar Al Jaberi wrot= e: >> Hej, >> >> I found that a panic can be generated when having a couple of >> ieee80211s nodes in a line topology with one of them being a ROOT >> node. A ping from ROOT in a newly started nodes causes a panic: >> panic: ieee80211_mesh_rt_add: adding self to the routing table >> KDB: enter: panic >> [ thread pid 0 tid 100030 ] >> Stopped at =A0 =A0 =A0kdb_enter+0x50: lui =A0 =A0 at,0x804e >> db> >> >> This is because we receive a copy of our own generated >> IEEE80211_ELEMID_MESHPREP packet from our neighbor node. >> I added check code in the begining of hwmp_recv_prep(...) similar to >> the check code found in hwmp_recv_preq(...). Here is a diff output: >> >> --- freebsd/head/sys/net80211/ieee80211_hwmp.c =A02010-11-03 >> 09:29:25.023610380 +0000 >> +++ src/head-current/sys/net80211/ieee80211_hwmp.c =A0 =A0 =A02011-02-15 >> 10:06:02.526163874 +0000 >> @@ -28,7 +28,7 @@ >> =A0*/ >> =A0#include >> =A0#ifdef __FreeBSD__ >> -__FBSDID("$FreeBSD$"); >> +__FBSDID("$FreeBSD: src/sys/net80211/ieee80211_hwmp.c,v 1.4.2.7.2.1 >> 2010/12/21 17:09:25 kensmith Exp $"); >> =A0#endif >> >> =A0/* >> @@ -951,6 +951,12 @@ >> =A0 =A0 =A0 =A0if (ni =3D=3D vap->iv_bss || >> =A0 =A0 =A0 =A0 =A0 =A0ni->ni_mlstate !=3D IEEE80211_NODE_MESH_ESTABLISH= ED) >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return; >> + =A0 =A0 =A0 /* >> + =A0 =A0 =A0 =A0* Ignore PREPs from us. Could happen because someone fo= rward it >> + =A0 =A0 =A0 =A0* back to us. >> + =A0 =A0 =A0 =A0*/ >> + =A0 =A0 =A0 if (IEEE80211_ADDR_EQ(vap->iv_myaddr, prep->prep_targetadd= r)) >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 return; >> =A0 =A0 =A0 =A0if (!IEEE80211_ADDR_EQ(vap->iv_myaddr, prep->prep_origadd= r) && >> =A0 =A0 =A0 =A0 =A0 =A0!(ms->ms_flags & IEEE80211_MESHFLAGS_FWD)) >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return; >> >> -- >> //Monthadar Al Jaberi >> _______________________________________________ >> 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" >> > --=20 //Monthadar Al Jaberi