From owner-freebsd-net@FreeBSD.ORG Tue Feb 15 12:00:57 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 1267A1065697 for ; Tue, 15 Feb 2011 12:00:57 +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 9F46C8FC17 for ; Tue, 15 Feb 2011 12:00:56 +0000 (UTC) Received: by fxm16 with SMTP id 16so94211fxm.13 for ; Tue, 15 Feb 2011 04:00:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=oOQ07tEcVl1cV3mSAKNLgUDnePyFM2gY4a9jxV0deug=; b=q2KgPqLGMrqiH7ETP08PgRb1U00RXDPBGSBOZV4fgK4QvTpo8M5V5FU1Ns138hCfif cv5BhKV/dUnoKR+tYcIWRhApLyiOYdZ19RtEZ6xZnlECYYiWLRvSwxC0pKoWL1/HIymZ karAAaEWTdjIkcy8z9RcBqJDjupuZbUukQMjo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=JYk3J1AONWXIwm3/mmgektn1Z74v1mHlXIRARhCjTjga7cEZrZIDWGV0QQjSkXSjII zSYC8DbhWQCqzB/gJVKFhgz7rhLvDMqbLCxL75LWa9fe6Md6C3amLXCXslhaKYvN5BH5 v5XM3+8U8ONZTqlklqT/f64MUfZpqGJ+rJMSM= MIME-Version: 1.0 Received: by 10.223.96.6 with SMTP id f6mr6075245fan.22.1297771254683; Tue, 15 Feb 2011 04:00:54 -0800 (PST) Received: by 10.223.97.71 with HTTP; Tue, 15 Feb 2011 04:00:54 -0800 (PST) Date: Tue, 15 Feb 2011 13:00:54 +0100 Message-ID: From: Monthadar Al Jaberi To: freebsd-net@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Subject: [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: Tue, 15 Feb 2011 12:00:57 -0000 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 kdb_enter+0x50: lui 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 2010-11-03 09:29:25.023610380 +0000 +++ src/head-current/sys/net80211/ieee80211_hwmp.c 2011-02-15 10:06:02.526163874 +0000 @@ -28,7 +28,7 @@ */ #include #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 $"); #endif /* @@ -951,6 +951,12 @@ if (ni == vap->iv_bss || ni->ni_mlstate != IEEE80211_NODE_MESH_ESTABLISHED) return; + /* + * Ignore PREPs from us. Could happen because someone forward it + * back to us. + */ + if (IEEE80211_ADDR_EQ(vap->iv_myaddr, prep->prep_targetaddr)) + return; if (!IEEE80211_ADDR_EQ(vap->iv_myaddr, prep->prep_origaddr) && !(ms->ms_flags & IEEE80211_MESHFLAGS_FWD)) return; -- //Monthadar Al Jaberi