From patchwork Thu Jul 30 18:23:21 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: stephen hemminger X-Patchwork-Id: 30393 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id 20206B7B9A for ; Fri, 31 Jul 2009 04:23:40 +1000 (EST) Received: by ozlabs.org (Postfix) id 0EB36DDDA2; Fri, 31 Jul 2009 04:23:40 +1000 (EST) Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id 9573EDDD1C for ; Fri, 31 Jul 2009 04:23:39 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751474AbZG3SX2 (ORCPT ); Thu, 30 Jul 2009 14:23:28 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751356AbZG3SX2 (ORCPT ); Thu, 30 Jul 2009 14:23:28 -0400 Received: from mail.vyatta.com ([76.74.103.46]:34461 "EHLO mail.vyatta.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751342AbZG3SX1 (ORCPT ); Thu, 30 Jul 2009 14:23:27 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.vyatta.com (Postfix) with ESMTP id 772B44F41EF; Thu, 30 Jul 2009 11:23:28 -0700 (PDT) X-Virus-Scanned: amavisd-new at tahiti.vyatta.com Received: from mail.vyatta.com ([127.0.0.1]) by localhost (mail.vyatta.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tgTvLUA7h0O5; Thu, 30 Jul 2009 11:23:23 -0700 (PDT) Received: from nehalam (pool-71-117-243-208.ptldor.fios.verizon.net [71.117.243.208]) by mail.vyatta.com (Postfix) with ESMTP id 914854F4049; Thu, 30 Jul 2009 11:23:23 -0700 (PDT) Date: Thu, 30 Jul 2009 11:23:21 -0700 From: Stephen Hemminger To: Patrick McHardy , David Miller Cc: netdev@vger.kernel.org Subject: [PATCH] vlan: allow creating vlan when real device is not up Message-ID: <20090730112321.35753739@nehalam> Organization: Vyatta X-Mailer: Claws Mail 3.6.1 (GTK+ 2.16.1; x86_64-pc-linux-gnu) Mime-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org There is no reason for the arbitrary restriction that device must be up to create a vlan. This patch was added to Vyatta kernel to resolve startup ordering issues where vlan's are created but real device was disabled. Note: the vlan already correctly inherits the operstate from real device; so if vlan is created and real device is marked down, the vlan is marked down. Signed-off-by: Stephen Hemminger --- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/net/8021q/vlan.c 2009-07-30 11:15:34.983190412 -0700 +++ b/net/8021q/vlan.c 2009-07-30 11:16:03.590055942 -0700 @@ -225,12 +225,6 @@ int vlan_check_real_dev(struct net_devic return -EOPNOTSUPP; } - /* The real device must be up and operating in order to - * assosciate a VLAN device with it. - */ - if (!(real_dev->flags & IFF_UP)) - return -ENETDOWN; - if (__find_vlan_dev(real_dev, vlan_id) != NULL) return -EEXIST;