From patchwork Fri Aug 21 06:58:34 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: 509378 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 BF6C6140B00 for ; Fri, 21 Aug 2015 16:59:03 +1000 (AEST) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id D892828448D; Fri, 21 Aug 2015 08:58:06 +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 A081E280947 for ; Fri, 21 Aug 2015 08:57:59 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 CL_IP_EQ_HELO_IP=-2 (check from: .foxmail. - helo: .smtpbg202.qq. - helo-domain: .qq.) FROM/MX_MATCHES_HELO(DOMAIN)=-2; rate: -8.5 Received: from smtpbg202.qq.com (smtpbg202.qq.com [184.105.206.29]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Fri, 21 Aug 2015 08:57:56 +0200 (CEST) X-QQ-mid: esmtp12t1440140319t116t15311 Received: from localhost (unknown [116.25.163.53]) by esmtp4.qq.com (ESMTP) with id ; Fri, 21 Aug 2015 14:58:38 +0800 (CST) X-QQ-SSF: B1000000000000F0FG100F00000000Z X-QQ-FEAT: c1sy7WzK7UBz39q6L0N0AqTHmIwTrgQpPW9ADJXtjKCf2RpNgUwXADQ4KJDPH 5/BwGNQ8pYvoiOuCzfuo/VRx34VORb8S/9FL7rpyr1A/frgMSbQkc3/Yal9/HdXnjkZGc4H 5d/lFGC4iRPjQmiz43C2ynLf+jTnfw8KaTFF3AcI0e7KLmmtr5PZl7WUThgF4/1b2iVn6/x 3XrPQNkLLpY97tMmz3+HMiqGDPSuw4Mm6uYsm+0Cxtn6L7CvIJQHX X-QQ-GoodBg: 0 From: "tymon.huang" To: nbd@openwrt.org Date: Fri, 21 Aug 2015 14:58:34 +0800 Message-Id: <1440140314-29845-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] [PATCH] 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" 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 \