From patchwork Sat Jun 11 13:54:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Fraser X-Patchwork-Id: 634061 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rRgYy6Syhz9sdm for ; Sat, 11 Jun 2016 23:56:22 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=netduma-com.20150623.gappssmtp.com header.i=@netduma-com.20150623.gappssmtp.com header.b=SU9d01H0; dkim-atps=neutral Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1bBjNS-0007JN-Eg; Sat, 11 Jun 2016 13:55:06 +0000 Received: from mail-wm0-x232.google.com ([2a00:1450:400c:c09::232]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1bBjNK-0006bb-HV for lede-dev@lists.infradead.org; Sat, 11 Jun 2016 13:55:01 +0000 Received: by mail-wm0-x232.google.com with SMTP id m124so24713797wme.1 for ; Sat, 11 Jun 2016 06:54:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netduma-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id; bh=WboKQcP9obgJUrbuZeFCcK1NO7+xyrxBmvtGzKWD6Ug=; b=SU9d01H0qSAZRYCxzo7PhcT8skAxSHF/l1id3fdUNlhleMztoRPmkiKaSkO4xxETPX vmFr0fxUqgZuC4hvpMCZ6VAg283cVKrMF+N3ZfEDzgiXkQy2jp0HPkN8bgcXRWS0XUsf QrGg6D08IEkpNCD6/50ZMdmpSPtFAY0t80/Oag/GsvvmjeqQYVE3gvmdB7Q2YGcqESYx rd6joWBTBjJbQ8Aq870nzXlqFx7yaSqjJAUefx+QKwWeIDT9R2ImjIpH6gNFT7qEMbtS 4jUyXkMC0qef7W/IDJCknmeh8UBEMROlGVT42LA4uKqOALXBr0lg8jpgTyHNQ1kgvIiC qpmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=WboKQcP9obgJUrbuZeFCcK1NO7+xyrxBmvtGzKWD6Ug=; b=T2amdtsKzgeldwT69wkyanzi/kQStPBlIQNfLx1Jbq2YLRfc2gU8EZt+rEY8HxeCep CqUeAfitiWTc3D2K+bmeUDJtywJHN57PS/VUZjqL22vTj6NuOq6jsP73aZkdp2SMIF84 wTN+JyMHevP9kstNjjJuhciFvOGmYrZFAGHxQRsykyk+DCTjFxGBwfdBNhlzO6NUE0z6 TNkkgBUftbaD/VwiXjJXiiHhmtT3P9KJ8KcbtNXiuPRFhedTN2zAfHC2+G7112U9PtZV g/toFg5IL+Q7GNv6nFjFJp6j32TvdHU2+Xv87UtEKT+NvvI7wSF5fAQTqU3X0l+WKSTY ttWQ== X-Gm-Message-State: ALyK8tLeJ98ZTwRV67hNADGWEF6zLnPBK+SOE1AoFeLFmSyEsV1Lwz+KfFZ9pHaIZog4Sg== X-Received: by 10.194.42.69 with SMTP id m5mr6901562wjl.89.1465653276448; Sat, 11 Jun 2016 06:54:36 -0700 (PDT) Received: from localhost.localdomain ([62.232.112.26]) by smtp.gmail.com with ESMTPSA id zg2sm17571484wjb.1.2016.06.11.06.54.35 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 11 Jun 2016 06:54:35 -0700 (PDT) From: Iain Fraser To: lede-dev@lists.infradead.org Date: Sat, 11 Jun 2016 14:54:32 +0100 Message-Id: <1465653272-29005-1-git-send-email-iainf@netduma.com> X-Mailer: git-send-email 1.7.9.5 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160611_065459_381867_4351B887 X-CRM114-Status: UNSURE ( 7.53 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2a00:1450:400c:c09:0:0:0:232 listed in] [list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid Subject: [LEDE-DEV] [PATCH] Pass method paraneter to Lua notifications. X-BeenThere: lede-dev@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "Lede-dev" Errors-To: lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org --- lua/ubus.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lua/ubus.c b/lua/ubus.c index f59af90..be54d8d 100644 --- a/lua/ubus.c +++ b/lua/ubus.c @@ -770,11 +770,12 @@ ubus_sub_notify_handler(struct ubus_context *ctx, struct ubus_object *obj, lua_remove(state, -2); if (lua_isfunction(state, -1)) { + lua_pushstring(state, method); if( msg ){ ubus_lua_parse_blob_array(state, blob_data(msg), blob_len(msg), true); - lua_call(state, 1, 0); + lua_call(state, 2, 0); } else { - lua_call(state, 0, 0); + lua_call(state, 1, 0); } } else { lua_pop(state, 1);