{"id":808638,"url":"http://patchwork.ozlabs.org/api/1.2/patches/808638/?format=json","web_url":"http://patchwork.ozlabs.org/project/lede/patch/1504264931-7435-1-git-send-email-karlp@etactica.com/","project":{"id":54,"url":"http://patchwork.ozlabs.org/api/1.2/projects/54/?format=json","name":"LEDE development","link_name":"lede","list_id":"lede-dev.lists.infradead.org","list_email":"lede-dev@lists.infradead.org","web_url":"http://lede-project.org/","scm_url":"","webscm_url":"http://git.lede-project.org/","list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<1504264931-7435-1-git-send-email-karlp@etactica.com>","list_archive_url":null,"date":"2017-09-01T11:22:11","name":"[LEDE-DEV,PATCHv2] odhcpd: don't enable server mode on non-static lan port","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"68b6f3bd68b5597a4b321dca173140d2e44609e5","submitter":{"id":70060,"url":"http://patchwork.ozlabs.org/api/1.2/people/70060/?format=json","name":"Karl Palsson","email":"karlp@etactica.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/lede/patch/1504264931-7435-1-git-send-email-karlp@etactica.com/mbox/","series":[{"id":1005,"url":"http://patchwork.ozlabs.org/api/1.2/series/1005/?format=json","web_url":"http://patchwork.ozlabs.org/project/lede/list/?series=1005","date":"2017-09-01T11:22:11","name":"[LEDE-DEV,PATCHv2] odhcpd: don't enable server mode on non-static lan port","version":1,"mbox":"http://patchwork.ozlabs.org/series/1005/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/808638/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/808638/checks/","tags":{},"related":[],"headers":{"Return-Path":"<lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org; spf=none (mailfrom)\n\tsmtp.mailfrom=lists.infradead.org (client-ip=65.50.211.133;\n\thelo=bombadil.infradead.org;\n\tenvelope-from=lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=lists.infradead.org\n\theader.i=@lists.infradead.org header.b=\"nR7qMUBJ\"; \n\tdkim-atps=neutral"],"Received":["from bombadil.infradead.org (bombadil.infradead.org\n\t[65.50.211.133])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xkH1235D4z9s72\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri,  1 Sep 2017 21:23:18 +1000 (AEST)","from localhost ([127.0.0.1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dnk2R-00014c-5f; Fri, 01 Sep 2017 11:23:03 +0000","from palmtree.beeroclock.net ([178.79.160.154])\n\tby bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dnk2M-00013V-Iq\n\tfor lede-dev@lists.infradead.org; Fri, 01 Sep 2017 11:23:00 +0000","from cuth.localdomain.localdomain (rtr1.dogg-hlidasmara14.sip.is\n\t[178.19.53.178])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits))\n\t(No client certificate requested) (Authenticated sender: karlp)\n\tby palmtree.beeroclock.net (Postfix) with ESMTPSA id 9725310154;\n\tFri,  1 Sep 2017 11:22:19 +0000 (UTC)"],"DKIM-Signature":"v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20170209; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe:\n\tList-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Subject:Message-Id:\n\tDate:To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:\n\tResent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:\n\tList-Owner; bh=J/zJbkn5t7K+twyqY0df8OGbO2ULtZDtQCJ2wFqgPho=;\n\tb=nR7qMUBJTRYxhu\n\tfuCDllmf7Q05AP+BtseXFc9J+Y4jpUePd0Rcy1WzJhdN/v5lfRBth2dnQotSNGCqGPb6fqm1PgRqY\n\tIpXS70p1XOgpeBStwNrLKSzbBnynVxt8dcPJeSjCYI9B4283fCv1V7dL/7JK+/f3GYZKHo33CY3Wf\n\tcbozg2LJKw4cN8rG4wGEO0laLVN0Y55jwXyqrgD0wYp3Iqt2lItMpyVlb96eNn154l999bOc4POR/\n\tSXBj8eSIf8/7mQL7uNCLa/s72oNxU8p/5AsgMP1znu8yIV4ISY4owt7CwG0zgp/ohzzO+rFp8tVnG\n\t9RPN4ZyXj5omOjphV//g==;","From":"Karl Palsson <karlp@etactica.com>","To":"lede-dev@lists.infradead.org","Date":"Fri,  1 Sep 2017 11:22:11 +0000","Message-Id":"<1504264931-7435-1-git-send-email-karlp@etactica.com>","X-Mailer":"git-send-email 2.4.11","X-CRM114-Version":"20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ","X-CRM114-CacheID":"sfid-20170901_042258_769707_B1E35E7C ","X-CRM114-Status":"UNSURE (   5.40  )","X-CRM114-Notice":"Please train this message.","X-Spam-Score":"-1.9 (-)","X-Spam-Report":"SpamAssassin version 3.4.1 on bombadil.infradead.org summary:\n\tContent analysis details:   (-1.9 points)\n\tpts rule name              description\n\t---- ----------------------\n\t--------------------------------------------------\n\t0.0 SPF_FAIL SPF: sender does not match SPF record (fail)\n\t[SPF failed: Please see http://www.openspf.org/Why?s=mfrom;\n\tid=karlp%40etactica.com; ip=178.79.160.154; r=bombadil.infradead.org]\n\t-1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%\n\t[score: 0.0000]","Subject":"[LEDE-DEV] [PATCHv2] odhcpd: don't enable server mode on non-static\n\tlan port","X-BeenThere":"lede-dev@lists.infradead.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<lede-dev.lists.infradead.org>","List-Unsubscribe":"<http://lists.infradead.org/mailman/options/lede-dev>,\n\t<mailto:lede-dev-request@lists.infradead.org?subject=unsubscribe>","List-Archive":"<http://lists.infradead.org/pipermail/lede-dev/>","List-Post":"<mailto:lede-dev@lists.infradead.org>","List-Help":"<mailto:lede-dev-request@lists.infradead.org?subject=help>","List-Subscribe":"<http://lists.infradead.org/mailman/listinfo/lede-dev>,\n\t<mailto:lede-dev-request@lists.infradead.org?subject=subscribe>","Cc":"Karl Palsson <karlp@etactica.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Sender":"\"Lede-dev\" <lede-dev-bounces@lists.infradead.org>","Errors-To":"lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org"},"content":"Instead of blindly enabling the odhcpd v6 server and RA server on the\nlan port, only do that if the lan port protocol is \"static\"\n\nThis prevents the unhelpful case of a device being a dhcpv4 client and\nv6 server on the same ethernet port.\n\nSigned-off-by: Karl Palsson <karlp@etactica.com>\n---\nChanges since v1\n* use /etc/board.json instead of assuming uci has been updated\n* make server _only_ for static, instead of everything but dhcp\n* remove logging, no other early service logs anything\n\n package/network/services/odhcpd/files/odhcpd.defaults | 17 +++++++++++++++++\n 1 file changed, 17 insertions(+)","diff":"diff --git a/package/network/services/odhcpd/files/odhcpd.defaults b/package/network/services/odhcpd/files/odhcpd.defaults\nindex e184da90acbb..e9b2353f063b 100644\n--- a/package/network/services/odhcpd/files/odhcpd.defaults\n+++ b/package/network/services/odhcpd/files/odhcpd.defaults\n@@ -2,6 +2,21 @@\n uci -q get dhcp.odhcpd && exit 0\n touch /etc/config/dhcp\n \n+. /usr/share/libubox/jshn.sh\n+\n+json_load \"$(cat /etc/board.json)\"\n+json_select network\n+json_select lan\n+json_get_vars protocol\n+json_select ..\n+json_select ..\n+\n+case \"$protocol\" in\n+# only enable server mode on statically addressed lan ports\n+\"static\") MODE=server ;;\n+*) MODE=disabled ;;\n+esac\n+\n uci batch <<EOF\n set dhcp.odhcpd=odhcpd\n set dhcp.odhcpd.maindhcp=0\n@@ -10,5 +25,7 @@ set dhcp.odhcpd.leasetrigger=/usr/sbin/odhcpd-update\n set dhcp.odhcpd.loglevel=4\n set dhcp.lan.dhcpv6=server\n set dhcp.lan.ra=server\n+set dhcp.lan.dhcpv6=$MODE\n+set dhcp.lan.ra=$MODE\n commit dhcp\n EOF\n","prefixes":["LEDE-DEV","PATCHv2"]}