From patchwork Thu Mar 31 10:18:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Dedecker X-Patchwork-Id: 604046 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (caladan.dune.hu [78.24.191.180]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3qbL893bbfz9sD1 for ; Thu, 31 Mar 2016 21:18:49 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=wmFA6WRU; dkim-atps=neutral Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id C4FEEB90DE3; Thu, 31 Mar 2016 12:18:37 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on arrakis.dune.hu X-Spam-Level: ** X-Spam-Status: No, score=2.4 required=5.0 tests=FREEMAIL_FROM,RDNS_NONE, T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.1 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP; Thu, 31 Mar 2016 12:18:37 +0200 (CEST) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 8F07BB90DDE for ; Thu, 31 Mar 2016 12:18:35 +0200 (CEST) X-policyd-weight: using cached result; rate: -7 Received: from mail-wm0-f65.google.com (unknown [74.125.82.65]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Thu, 31 Mar 2016 12:18:35 +0200 (CEST) Received: by mail-wm0-f65.google.com with SMTP id i204so20521469wmd.0 for ; Thu, 31 Mar 2016 03:18:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=Fu8ssW9QmckXal7onTFNhT/VpixexAn6zpjQsODW5BU=; b=wmFA6WRUAfywQF0x/7TCjR8wTpUNShUgPaUN8Fc4cGITg9N8JlfFXZzIRZ+FAlHE99 Td8E/6B87NRDEviTdDQ/i5itaS3UXGv1BaEIdeZQ/oEhhARq59KjuVle5ESX+QrcNzIH fXFNjPk+5XC8/ct9q9L/kqsoNitq4X/xPmLqM/JIz5k9tBejorhAVin8X8wi/MbieGw6 ucXt+LxrWHE4ZSv7qL/15a1ku2OkMHCC4/ZoVEH1ZHVA27CCnG0uRRCA28CRrEN0oZfF g11PD+/3ojYBBAo/OlKAHavFf+k7EKa8EyavVPVSM4pGA2Us2KOdorI6d2eM32nNm4xs 1+Zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Fu8ssW9QmckXal7onTFNhT/VpixexAn6zpjQsODW5BU=; b=fqOKijWy318i11JZ5GiQopdMGAdnq2R/NqxPgwA1h3ApR0/bMq7gYMzkMR9+ozTpVE vv2Q07rqfrk9JwCskknWcBumfYKnrh5onJXxC11GIJ0B8XhjdG6C4y0DIgIWzFSZ96DN oRczfPfH7a365grJgpzID18NqgcVjnYkcaF/19ynFnF6qy/6WtEcahjlvKqaskRoRqJJ XIpX6KOPN8mF5R7Yn9X46K2lbuMPIfQqx4jXCAbqt8wjCLf7H2Iv4PXDelJsQ87jN4VX FKPUIDgGakXhWfA04Av79b8dKP5cAHP18wtAoBVq7SySXAsr31uXGxWtfy7K20iP+tMG TOsw== X-Gm-Message-State: AD7BkJJE2p+YNKrKy8ae/iTtKMq2hpntkvHRxKBRnAheakfcSCQsDJV0Ds4nLAGC7Ux0IQ== X-Received: by 10.194.58.169 with SMTP id s9mr14738064wjq.52.1459419514951; Thu, 31 Mar 2016 03:18:34 -0700 (PDT) Received: from cplx43.eu.thmulti.com ([141.11.62.7]) by smtp.gmail.com with ESMTPSA id 198sm8800980wml.22.2016.03.31.03.18.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 31 Mar 2016 03:18:34 -0700 (PDT) From: Hans Dedecker To: openwrt-devel@lists.openwrt.org Date: Thu, 31 Mar 2016 12:18:27 +0200 Message-Id: <1459419510-24449-1-git-send-email-dedeckeh@gmail.com> X-Mailer: git-send-email 1.9.1 Subject: [OpenWrt-Devel] [PATCH netifd] alias : Fix interface aliased on top of a static interface not getting active X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Hans Dedecker , cyrus@openwrt.org MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" An interfaces referring to a static interface is not getting active when doing a network reload or ifup. The problem is triggered by alias_set_device which is not clearing the pending update (mostly a null device due to the previous down event) when the same device is set as the current device via alias_notify_device. As a result alias_set_device_state when called will overwrite the device with an invalid pending device meaning the interface will not be set available anymore and thus will stay down. Signed-off-by: Hans Dedecker --- alias.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/alias.c b/alias.c index 1f23da0..e4bb700 100644 --- a/alias.c +++ b/alias.c @@ -34,8 +34,15 @@ static const struct device_type alias_device_type; static void alias_set_device(struct alias_device *alias, struct device *dev) { - if (dev == alias->dep.dev) + if (dev == alias->dep.dev) { + if (alias->update) { + device_remove_user(&alias->new_dep); + alias->update = false; + if (dev) + device_set_present(&alias->dev, true); + } return; + } device_set_present(&alias->dev, false); device_remove_user(&alias->new_dep);