From patchwork Thu Jul 14 08:14:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Dedecker X-Patchwork-Id: 648262 X-Patchwork-Delegate: blogic@openwrt.org 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 3rqpRC20Nyz9s6r for ; Thu, 14 Jul 2016 18:15:19 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=Kj3M+JCF; dkim-atps=neutral Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 4B70CB80791; Thu, 14 Jul 2016 10:14:55 +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=-1.5 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=unavailable 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, 14 Jul 2016 10:14:55 +0200 (CEST) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 11C7AB80780 for ; Thu, 14 Jul 2016 10:14:52 +0200 (CEST) X-policyd-weight: using cached result; rate:hard: -7 Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com [74.125.82.65]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Thu, 14 Jul 2016 10:14:52 +0200 (CEST) Received: by mail-wm0-f65.google.com with SMTP id o80so8565677wme.0 for ; Thu, 14 Jul 2016 01:14:52 -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:in-reply-to:references; bh=vj4xaAbdQ6hHupjEEEF619tOsESQUW+KYwduZPAj8qk=; b=Kj3M+JCFIdzDWNXfdQZMhn9I6iU69rnNau0EPN8+AOXkNM0p/vlulQ+GfVuBHwhT1a zV3hgqUb3xd/p1C4HtP0EyevNGehhuRv8m4aZvY90Bd/nf9AJpb7OgHlRKf24h4TtEpf UYUPAq2nCDWIo5Wq40GWgnLRtMREgGqHI5dVtzfI8UR+64lIrI27M9ZqRqZDYoBOESdX Z/DnpGpc5Y5FbEq/wt36+FVyK0MLzg3bV2ZpMmjN2LHt2m4tkaN4Bzl2OS3bTIX1Evpi qYsZ2Zp00kNtgqnS5cyTJSSXUxFh15ZwfCgd+4DOAHVeJqlUEllYJLwRW3BMn4XRwck5 Emzw== 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:in-reply-to :references; bh=vj4xaAbdQ6hHupjEEEF619tOsESQUW+KYwduZPAj8qk=; b=OfNdbqKIcRuvlv+PXrbewYRTh9t4Yj+eyTxBVd7TGuNF5b/UNkmG4zMVTs+sUeINd/ 7b8S7RSAw0wN3naiw4tcFnOCUOJ4Kh3zUymcMq6zp+l0R1akN7GDQ2eCLdzBWrFmHwap Nky8SFqUvm3tC1htAuDTtRwpCXh8dXbxKkXOkIcqw7iy1oAe0AHgyBmK+xmDNDel8E3J J69DH5KuofNJ1m+IzMI5szWyg+2qD46Ok/HjXoXmCADgVdT/2HfFhXYHW/Clb3ox6DGX APkv2nLH73sZZvZd5RJNNc08ks7h9zGILljkCkGgkjjvOzt2v0vK86/EF6mt8agZkqdZ ulAQ== X-Gm-Message-State: ALyK8tLQJHXPpluWyH11SgRXGPuOMHvph1Oww64sqDYpD/TbRLBwUYzInN8oCkbIW9PKBw== X-Received: by 10.194.58.45 with SMTP id n13mr5304180wjq.69.1468484091741; Thu, 14 Jul 2016 01:14:51 -0700 (PDT) Received: from cplx43.eu.thmulti.com ([141.11.62.7]) by smtp.gmail.com with ESMTPSA id ju2sm1164384wjc.14.2016.07.14.01.14.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 14 Jul 2016 01:14:51 -0700 (PDT) From: Hans Dedecker To: openwrt-devel@lists.openwrt.org, lede-dev@lists.infradead.org Date: Thu, 14 Jul 2016 10:14:14 +0200 Message-Id: <1468484055-27341-2-git-send-email-dedeckeh@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1468484055-27341-1-git-send-email-dedeckeh@gmail.com> References: <1468484055-27341-1-git-send-email-dedeckeh@gmail.com> Subject: [OpenWrt-Devel] [PATCH netifd 2/3] interface: Only teardown interfaces having no proto task when l3_dev link lost 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 , steven@midlink.org MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" Commit c6858766 adds teardown support when l3_dev link is lost especially for shell protocols that have no proto task. However shell protocols which have a proto task running like ppp will also be teared down which is not always the expected action. As an example the PPP daemon can be put into persist state trying to re-establish the link via a hold off mechanism which is not possible when the daemon is terminated by the proto shell teardown. Therefore restrict the teardown action for shell protocols having no proto task. Signed-off-by: Hans Dedecker --- interface.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/interface.c b/interface.c index 7b18cef..8d9dc9c 100644 --- a/interface.c +++ b/interface.c @@ -408,7 +408,8 @@ interface_l3_dev_cb(struct device_user *dep, enum device_event ev) switch (ev) { case DEV_EVENT_LINK_DOWN: - interface_proto_event(iface->proto, PROTO_CMD_TEARDOWN, false); + if (iface->proto->handler->flags & PROTO_FLAG_NO_TASK) + interface_proto_event(iface->proto, PROTO_CMD_TEARDOWN, false); break; default: break;