From patchwork Tue Sep 8 21:13:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brandon Maier X-Patchwork-Id: 1360093 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=rockwellcollins.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=rockwellcollins.com header.i=@rockwellcollins.com header.a=rsa-sha256 header.s=hrcrc2020 header.b=Ed/oYydz; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BmHv86sMvz9sRK for ; Wed, 9 Sep 2020 07:13:40 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 51E6B204B5; Tue, 8 Sep 2020 21:13:37 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id SlnwMduqmqYQ; Tue, 8 Sep 2020 21:13:34 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 425D720797; Tue, 8 Sep 2020 21:13:34 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 391A91BF3AD for ; Tue, 8 Sep 2020 21:13:33 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 3277C86CB4 for ; Tue, 8 Sep 2020 21:13:33 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IgRI2tgAxL+E for ; Tue, 8 Sep 2020 21:13:31 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from da1vs03.rockwellcollins.com (da1vs03.rockwellcollins.com [205.175.227.47]) by whitealder.osuosl.org (Postfix) with ESMTPS id 7E39987040 for ; Tue, 8 Sep 2020 21:13:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rockwellcollins.com; s=hrcrc2020; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=+W/dlKrnVBduuQagC1cek0RJ7HyJ4iX5bmh4sSTYDgU=; b=Ed/oYydzcxDaoQSkF7EmZgFEVSbeu9UiZcs6oD4jgLrGfApWMShU186Z ZPozczfx4mIB+scHVxCow9psfL1bn9vJhY62nOyvm2QkCGoHulN9WWMiO zI4NN1dl3h8gGJ8EcpkW8GjTgHP6VXx9JEV7pUBhPgIYbD0f7Vti41FCr 69nwEHCNk4JXO4ZR1B5j0f7dDP7iEXHkq8++HIA7iRFjxH1skYrB2msx3 4qHYIDrprTC2wy/j2XuFjLhiLn5qZAATlD62GelGHH166J3z0fUwPxVCU iiGqeiR1NjTpkCgBDkzzkLlE4A8iywMj7EkeNrKuVBYPEZvU2AZr/0IUz g==; IronPort-SDR: +qV8bzC1XNnPYStCCRfT0eazQfcpZ+hvW9Xc324ZXR9Yk0JM2hyaoQEkcOlDp8AV7ngIXVPZbR NO759KZd/uK+njLZJv7d3ujDtmc7+wJJd7/83RYGsk6DkFo/z2T/lcn6M2U90g/c4nY8yS41Dw n8ZH6scr3qKs8Ih9ohanVvwmChQDbqFgyI+ft/Fffc/zty+CxN6hcz6tQsk4f4rNkYKnh3H8kI 4lpkjon9pacqRIYkugaaWODKEkT7YqBTyw2c/SSm51j4yhUYVC1JTyFXEPHfh3QljQ8FmV+mhw Lx8= Received: from ofwda1n02.rockwellcollins.com (HELO ciulimr02.rockwellcollins.com) ([205.175.227.14]) by da1vs03.rockwellcollins.com with ESMTP; 08 Sep 2020 16:13:30 -0500 X-Received: from righttwix.rockwellcollins.com (righttwix.rockwellcollins.com [192.168.141.218]) by ciulimr02.rockwellcollins.com (Postfix) with ESMTP id BB32E20051; Tue, 8 Sep 2020 16:13:29 -0500 (CDT) From: Brandon Maier To: buildroot@buildroot.org Date: Tue, 8 Sep 2020 16:13:12 -0500 Message-Id: <20200908211313.107946-3-brandon.maier@rockwellcollins.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200908211313.107946-1-brandon.maier@rockwellcollins.com> References: <20200908211313.107946-1-brandon.maier@rockwellcollins.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH 2020.02.x 3/4] package/systemd: Backport fix for network-generator X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter@korsgaard.com, Brandon Maier , "Yann E . MORIN" , Adam Duskett , Maxime Hadjinlian Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" The systemd-network-generator.service will fail to parse the bootarg "ip=xxx" if it's missing the (optional) hostname field. Backport this fix from systemd v245. Signed-off-by: Brandon Maier --- ...twork-generator-allow-empty-hostname.patch | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 package/systemd/0003-network-generator-allow-empty-hostname.patch diff --git a/package/systemd/0003-network-generator-allow-empty-hostname.patch b/package/systemd/0003-network-generator-allow-empty-hostname.patch new file mode 100644 index 0000000000..37eb91bfaf --- /dev/null +++ b/package/systemd/0003-network-generator-allow-empty-hostname.patch @@ -0,0 +1,41 @@ +From 21a925a4ac7955e7d7e6cfd477e96d3a2aaee7db Mon Sep 17 00:00:00 2001 +From: Yu Watanabe +Date: Thu, 12 Dec 2019 19:01:21 +0900 +Subject: [PATCH 1/1] network-generator: allow empty hostname + +Fixes #14319. +--- + src/network/generator/network-generator.c | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +diff --git a/src/network/generator/network-generator.c b/src/network/generator/network-generator.c +index 81afa95307..bed1e42697 100644 +--- a/src/network/generator/network-generator.c ++++ b/src/network/generator/network-generator.c +@@ -574,7 +574,7 @@ static int parse_netmask_or_prefixlen(int family, const char **value, unsigned c + + static int parse_cmdline_ip_address(Context *context, int family, const char *value) { + union in_addr_union addr = {}, peer = {}, gateway = {}; +- const char *hostname, *ifname, *dhcp_type, *dns, *p; ++ const char *hostname = NULL, *ifname, *dhcp_type, *dns, *p; + unsigned char prefixlen; + int r; + +@@ -599,9 +599,11 @@ static int parse_cmdline_ip_address(Context *context, int family, const char *va + if (!p) + return -EINVAL; + +- hostname = strndupa(value, p - value); +- if (!hostname_is_valid(hostname, false)) +- return -EINVAL; ++ if (p != value) { ++ hostname = strndupa(value, p - value); ++ if (!hostname_is_valid(hostname, false)) ++ return -EINVAL; ++ } + + value = p + 1; + +-- +2.23.0 +