From patchwork Fri Aug 21 07:12:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "b.l.huang" X-Patchwork-Id: 509380 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 0ADC21402C8 for ; Fri, 21 Aug 2015 17:13:16 +1000 (AEST) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 5AD6628BBFD; Fri, 21 Aug 2015 09:12:22 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable version=3.3.2 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id E83EF280947 for ; Fri, 21 Aug 2015 09:12:12 +0200 (CEST) X-policyd-weight: using cached result; rate: -8.5 Received: from smtpproxy19.qq.com (smtpproxy19.qq.com [184.105.206.84]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Fri, 21 Aug 2015 09:12:12 +0200 (CEST) X-QQ-mid: esmtp28t1440141177t474t20179 Received: from localhost (unknown [116.25.163.53]) by esmtp4.qq.com (ESMTP) with id ; Fri, 21 Aug 2015 15:12:57 +0800 (CST) X-QQ-SSF: B1000000000000F0FG100F00000000Z X-QQ-FEAT: jsiTeXvtTgD3EPFDAvy0UEIVyBXFE4TYVJO+FuObegj8nl/xyX5ndTMDv9Dnl 38OykABmOtncP9xuMVtg1PseiHDs1U+Q1Y5Zx+ywvLhkv3NDeM32oG1PDW3y2ZzsZ/WmBBX 8qimW7kRc2qH0KHOwDh0eWRv+8OCU25tuLJpW3OTThasmTl0ymobdCpXgB02BfoiCYhLV3Q 8c7UDHzGVB8jgNWrPbs5/uu8+MpT+qW2tyHcOZtPEFGjlvqOq/I+y X-QQ-GoodBg: 0 From: "tymon.huang" To: nbd@openwrt.org Date: Fri, 21 Aug 2015 15:12:52 +0800 Message-Id: <1440141172-30455-1-git-send-email-banglang.huang@foxmail.com> X-Mailer: git-send-email 1.9.1 X-QQ-SENDSIZE: 520 X-QQ-Bgrelay: 1 Cc: cyrus@openwrt.org, openwrt-devel@lists.openwrt.org Subject: [OpenWrt-Devel] [netifd][PATCH v3] proto-shell: add hostname validation check for netifd dhcp script X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" This patch can fix the issue that luci web shows '?' sign when WAN port work on DHCP-client mode without setting hostname. After adding the hostname check, the udhcpc can work with '-H' parameter correctly and send hostname to dhcp server. Signed-off-by: tymon.huang --- package/network/config/netifd/files/lib/netifd/proto/dhcp.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh b/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh index 0e88af9..bf91c29 100755 --- a/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh +++ b/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh @@ -47,6 +47,7 @@ proto_dhcp_setup() { [ -n "$mtu6rd" ] && proto_export "MTU6RD=$mtu6rd" [ -n "$customroutes" ] && proto_export "CUSTOMROUTES=$customroutes" [ "$delegate" = "0" ] && proto_export "IFACE6RD_DELEGATE=0" + [ -z "$hostname" ] && hostname="$(uci_get system @system[0] hostname OpenWrt)" proto_export "INTERFACE=$config" proto_run_command "$config" udhcpc \