From patchwork Wed Nov 11 16:23:31 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felix Fietkau X-Patchwork-Id: 59353 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nABGNbXZ019048 for ; Wed, 11 Nov 2009 16:23:37 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752536AbZKKQXa (ORCPT ); Wed, 11 Nov 2009 11:23:30 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755266AbZKKQXa (ORCPT ); Wed, 11 Nov 2009 11:23:30 -0500 Received: from nbd.name ([88.198.39.176]:41243 "EHLO ds10.mine.nu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752260AbZKKQX3 (ORCPT ); Wed, 11 Nov 2009 11:23:29 -0500 Received: from p5ddc7c19.dip.t-dialin.net ([93.220.124.25] helo=pi.lan) by ds10.mine.nu with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1N8G2d-0008U6-Ro; Wed, 11 Nov 2009 17:27:31 +0100 Message-ID: <4AFAE503.3030602@openwrt.org> Date: Wed, 11 Nov 2009 17:23:31 +0100 From: Felix Fietkau User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 To: linux-wireless CC: "John W. Linville" , Johannes Berg Subject: [PATCH] nl80211: only allow adding stations to running vlan interfaces X-Enigmail-Version: 0.96.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -1813,7 +1813,7 @@ static int nl80211_get_station(struct sk } /* - * Get vlan interface making sure it is on the right wiphy. + * Get vlan interface making sure it is running and on the right wiphy. */ static int get_vlan(struct genl_info *info, struct cfg80211_registered_device *rdev, @@ -1831,6 +1831,8 @@ static int get_vlan(struct genl_info *in return -EINVAL; if ((*vlan)->ieee80211_ptr->wiphy != &rdev->wiphy) return -EINVAL; + if (!netif_running(*vlan)) + return -ENETDOWN; } return 0; }