From patchwork Thu Dec 11 15:48:01 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Dedecker X-Patchwork-Id: 420169 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.1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 9010C1400B7 for ; Fri, 12 Dec 2014 02:48:41 +1100 (AEDT) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 4DF0B28BBDC; Thu, 11 Dec 2014 16:46:47 +0100 (CET) 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, T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 4D18428BBD7 for ; Thu, 11 Dec 2014 16:46:34 +0100 (CET) X-policyd-weight: using cached result; rate: -8.5 Received: from mail-wi0-f180.google.com (mail-wi0-f180.google.com [209.85.212.180]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Thu, 11 Dec 2014 16:46:30 +0100 (CET) Received: by mail-wi0-f180.google.com with SMTP id n3so9101138wiv.7 for ; Thu, 11 Dec 2014 07:48:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=TOkyWib52mMAgJmjyWz8GluRVMBTNqk9uWCVrhifBDI=; b=nDmy83Fr/ZwzHe1nkfmpRAKxUkudT/WC8kTT88HN7cNIXYW1iHqLliPvtqZ5WbmLjg K0CZXrbNGwx898JIvL/uywr54HLHKYokvqIqdHY8cg2KPwpEpiykgR/RW5BWR6eSYxUM UFMFCKfw8M5DnR+jvX/6XhXQFvcddKUKDJ51iA+DpQf8X3zRS73TWeBXDAH+z1Osm0qX c8a4+Aef3hlQBjiqLJ7xk4CxZPE2zyc5YpfpLLwS9pERHR90/QXiuorGWsSgRAPeZm1Q ZVfN1D4/7VDIxuVTgEguIDTVM40OmSxPKu1ZCQBaBdDHgK5i4iJecIjYijFx7l1t+40d TOsQ== X-Received: by 10.180.99.1 with SMTP id em1mr24305535wib.29.1418312896241; Thu, 11 Dec 2014 07:48:16 -0800 (PST) Received: from cplx43.eu.thmulti.com ([141.11.62.7]) by mx.google.com with ESMTPSA id xt9sm2121559wjc.42.2014.12.11.07.48.14 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 11 Dec 2014 07:48:15 -0800 (PST) From: Hans Dedecker To: openwrt-devel@lists.openwrt.org Date: Thu, 11 Dec 2014 16:48:01 +0100 Message-Id: <1418312881-23018-1-git-send-email-dedeckeh@gmail.com> X-Mailer: git-send-email 1.9.1 Cc: Hans Dedecker , cyrus@openwrt.org Subject: [OpenWrt-Devel] [PATCH] netifd: Set source IP for DHCP static routes as well 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" Commit ce92f6650bd8a86db04c7a6cbb58e7fdb200a7e6 added source IP support for DHCP default routes. As a side effect of this change the default route could be present twice in netifd (once with source IP set and once with source IP unset) if it was sent by the server in both the router and static route options. Therefore add source IP support as well for static routes as this case was not considered. Additional remove unused parameter type. Signed-off-by: Hans Dedecker --- package/network/config/netifd/files/lib/netifd/dhcp.script | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/package/network/config/netifd/files/lib/netifd/dhcp.script b/package/network/config/netifd/files/lib/netifd/dhcp.script index 17e22af..54d3aa1 100755 --- a/package/network/config/netifd/files/lib/netifd/dhcp.script +++ b/package/network/config/netifd/files/lib/netifd/dhcp.script @@ -6,9 +6,8 @@ set_classless_routes() { local max=128 - local type while [ -n "$1" -a -n "$2" -a $max -gt 0 ]; do - proto_add_ipv4_route "${1%%/*}" "${1##*/}" "$2" + proto_add_ipv4_route "${1%%/*}" "${1##*/}" "$2" "$ip" max=$(($max-1)) shift 2 done