From patchwork Mon Jun 16 14:26:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jithu Jance X-Patchwork-Id: 360149 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from maxx.maxx.shmoo.com (maxx.shmoo.com [205.134.188.171]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 68FD314007B for ; Tue, 17 Jun 2014 00:27:07 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id BB7499C12C; Mon, 16 Jun 2014 10:27:03 -0400 (EDT) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BOok8mUITL8A; Mon, 16 Jun 2014 10:27:03 -0400 (EDT) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 811269C133; Mon, 16 Jun 2014 10:26:54 -0400 (EDT) X-Original-To: mailman-post+hostap@maxx.shmoo.com Delivered-To: mailman-post+hostap@maxx.shmoo.com Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 207199C133 for ; Mon, 16 Jun 2014 10:26:53 -0400 (EDT) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KrHyI6xmskja for ; Mon, 16 Jun 2014 10:26:48 -0400 (EDT) Received: from mail-la0-f43.google.com (mail-la0-f43.google.com [209.85.215.43]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (not verified)) by maxx.maxx.shmoo.com (Postfix) with ESMTPS id 4F01A9C178 for ; Mon, 16 Jun 2014 10:26:35 -0400 (EDT) Received: by mail-la0-f43.google.com with SMTP id e16so3033697lan.2 for ; Mon, 16 Jun 2014 07:26:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=4gRmx8dYpC/rfLwwIhBd7VjTwAUrM0Hp+8VFO4GemGg=; b=vULjnfsqljboTM7dnx9vH/9F3lttwgFSmqWzVshNGuu29I4JnAiARkm1qr2/ZhghKP avAfPHAC3zoxy2xGgP6b/TVPU7hz/fNxxgk6wrxSRkD4XAbRLk3cRNOWvFBVDlif0nMY YX0Jxe3YQmZgmq5Yi1OZ8EWRmR4IHltH6TDkamvgWKUsJGeYWww1wjqd/XaJqz+Atska Q2nO/8GTs1X2c+sZMu0HhLaI9F31pYROajkvGEzyNsiA+OvawfQZI3Oc9/1tIsQOAwgm 8+sesW+4p7MckJ2j+fQlKASG3F+BC+tq1dmVNkv90zwj2RYQbJAc4AQR5scgJIuLS+48 Cnug== X-Received: by 10.112.201.106 with SMTP id jz10mr1752356lbc.62.1402928792132; Mon, 16 Jun 2014 07:26:32 -0700 (PDT) MIME-Version: 1.0 Received: by 10.112.202.73 with HTTP; Mon, 16 Jun 2014 07:26:12 -0700 (PDT) In-Reply-To: References: <5b014d8858cf9e4b703902a743588b51d3682e60.1402299980.git.jithu@broadcom.com> <20140611213033.GB26186@w1.fi> From: Jithu Jance Date: Mon, 16 Jun 2014 19:56:12 +0530 Message-ID: Subject: Re: [PATCH 1/1] P2P: Ignore RTM_NEWLINK event for the P2P Discovery Interface To: Dmitry Shmidt Cc: hostap X-BeenThere: hostap@lists.shmoo.com X-Mailman-Version: 2.1.11 Precedence: list List-Id: HostAP Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: hostap-bounces@lists.shmoo.com Errors-To: hostap-bounces@lists.shmoo.com Looks like last email got the patch as white space corrupted. So sending it again. Signed-off-by: Jithu Jance --- src/drivers/driver_nl80211.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) return 0; } -- 1.7.9.5 > Jithu Jance On Sun, Jun 15, 2014 at 6:53 PM, Jithu Jance wrote: > Hi Jouni/Dmitry, > > I applied the logic of the commit:147848ec4d26613d5a117d4b35dbc7ff98dd65d1 > to wpa_driver_nl80211_if_add function as well. Please see whether this > patch is fine. > > Signed-off-by: Jithu Jance > --- > src/drivers/driver_nl80211.c | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) > > diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c > index 7568653..baef09d 100644 > --- a/src/drivers/driver_nl80211.c > +++ b/src/drivers/driver_nl80211.c > @@ -10177,8 +10177,16 @@ static int wpa_driver_nl80211_if_add(void > *priv, enum wpa_driver_if_type type, > if (drv->global) > drv->global->if_add_ifindex = ifidx; > > - if (ifidx > 0) > + /* > + * Some virtual interfaces need to process EAPOL packets and events on > + * the parent interface. This is used mainly with hostapd. > + */ > + if ((ifidx > 0) && (drv->hostapd || > + nlmode == NL80211_IFTYPE_AP_VLAN || > + nlmode == NL80211_IFTYPE_WDS || > + nlmode == NL80211_IFTYPE_MONITOR)) { > add_ifidx(drv, ifidx); > + } > > return 0; > } > -- > 1.7.9.5 > > > >> Jithu Jance > > > > > > On Sat, Jun 14, 2014 at 7:34 PM, Jithu Jance wrote: >> Hi Dmitry & Jouni, >> >> Thanks for looking into this. I think I didn't dig deep enough. I will >> also check this and try to come up with a patch to address this. >> >> >> Thanks, >> >> >> >>> Jithu Jance >> >> >> >> >> >> On Sat, Jun 14, 2014 at 5:18 AM, Dmitry Shmidt wrote: >>> On Fri, Jun 13, 2014 at 4:10 PM, Dmitry Shmidt wrote: >>>> On Wed, Jun 11, 2014 at 2:30 PM, Jouni Malinen wrote: >>>>> On Mon, Jun 09, 2014 at 01:26:42AM -0700, Jithu Jance wrote: >>>>>> Patch for Ignoring the RTM event for the dedicated P2P discovery >>>>>> Interface. Without the patch the IFFUP operation on the interface >>>>>> was failing (since there is no network device associated with the >>>>>> interface). >>>>> >>>>>> + if (drv->nlmode == NL80211_IFTYPE_P2P_DEVICE) { >>>>>> + wpa_printf(MSG_INFO, "nl80211: Ignore RTM_NEWLINK for P2P Discovery Interface"); >>>>>> + return; >>>>>> + } >>>>> >>>>> Hmm.. How does NL82011_IFTYPE_P2P_DEVICE even get a RTM_NEWLINK event? >>>>> The main point of that was to not have a netdev.. Could you please share >>>>> a debug log showing what this looks like without this change? >>>> >>>> I think RTM_NEWLINK is received for group interface but this code fails it: >>>> >>>> if (!drv->if_disabled && !(ifi->ifi_flags & IFF_UP)) { >>>> if (if_indextoname(ifi->ifi_index, namebuf) && >>>> linux_iface_up(drv->global->ioctl_sock, >>>> drv->first_bss->ifname) > 0) { <<<< Here !!! >>>> wpa_printf(MSG_DEBUG, "nl80211: Ignore interface down " >>>> "event since interface %s is up", namebuf); >>>> return; >>>> } >>>> wpa_printf(MSG_DEBUG, "nl80211: Interface down"); >>>> >>>> >>>> Because namebuf == p2p-wlan0-0 and drv->first_bss->ifname == p2p-dev-wlan0, >>>> where p2p-wlan0-0 is group interface, and p2p-dev-wlan0 is Non-NETDEV p2p. >>> >>> It looks like this change >>> http://hostap.epitest.fi/cgit/hostap/commit/?id=b36935be1a14341771b0fd5491808c3f6fdcb603 >>> causes nl80211_find_drv() to return wrong pointer. >>> >>>> >>>>> >>>>> -- >>>>> Jouni Malinen PGP id EFC895FA >>>>> _______________________________________________ >>>>> HostAP mailing list >>>>> HostAP@lists.shmoo.com >>>>> http://lists.shmoo.com/mailman/listinfo/hostap >>> _______________________________________________ >>> HostAP mailing list >>> HostAP@lists.shmoo.com >>> http://lists.shmoo.com/mailman/listinfo/hostap diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 7568653..baef09d 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -10177,8 +10177,16 @@ static int wpa_driver_nl80211_if_add(void *priv, enum wpa_driver_if_type type, if (drv->global) drv->global->if_add_ifindex = ifidx; - if (ifidx > 0) + /* + * Some virtual interfaces need to process EAPOL packets and events on + * the parent interface. This is used mainly with hostapd. + */ + if ((ifidx > 0) && (drv->hostapd || + nlmode == NL80211_IFTYPE_AP_VLAN || + nlmode == NL80211_IFTYPE_WDS || + nlmode == NL80211_IFTYPE_MONITOR)) { add_ifidx(drv, ifidx); + }