From patchwork Thu Nov 11 22:08:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 34403 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 6880727BBE3; Thu, 11 Nov 2021 22:09:15 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,T_DKIM_INVALID, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id ECFAB27BBE1 for ; Thu, 11 Nov 2021 22:09:14 +0000 (GMT) Received: from localhost ([::1]:48634 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mlIFu-00004y-29 for patchwork@mira.cbaines.net; Thu, 11 Nov 2021 17:09:14 -0500 Received: from eggs.gnu.org ([209.51.188.92]:46242) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mlIFi-0008WG-VK for guix-patches@gnu.org; Thu, 11 Nov 2021 17:09:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:59187) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mlIFi-0001hx-My for guix-patches@gnu.org; Thu, 11 Nov 2021 17:09:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mlIFi-0005nO-8s for guix-patches@gnu.org; Thu, 11 Nov 2021 17:09:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#51440] [PATCH 00/10] Declarative static networking interface Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 11 Nov 2021 22:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51440 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: David Aaron Fendley Cc: 51440@debbugs.gnu.org Received: via spool by 51440-submit@debbugs.gnu.org id=B51440.163666853322259 (code B ref 51440); Thu, 11 Nov 2021 22:09:02 +0000 Received: (at 51440) by debbugs.gnu.org; 11 Nov 2021 22:08:53 +0000 Received: from localhost ([127.0.0.1]:42500 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mlIFY-0005mx-JU for submit@debbugs.gnu.org; Thu, 11 Nov 2021 17:08:52 -0500 Received: from eggs.gnu.org ([209.51.188.92]:45480) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mlIFT-0005md-I5 for 51440@debbugs.gnu.org; Thu, 11 Nov 2021 17:08:51 -0500 Received: from [2001:470:142:3::e] (port=46558 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mlIFO-0001hG-06; Thu, 11 Nov 2021 17:08:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=Mqena+G2rALlvCHSnUb6FzklWJefL1oDQ3MIawd/5RI=; b=qEJDSxjs1pkpfv/kPizT Aax1hPcyTpD5LZRGUaS6WAM6NvzeY7qlAPpZriu7UYCFLAUsq0V4v/jJUPru6kLyKMnC/zPXj8Hfl kl5zATaZMQKMDlrHNV+u1V4Ag93rQ8JQjYDQFs6RhGNUI8+vXWQwjJa7NoQnD0B/YgjLd9I2X5foe t2pRSvn9ElLRBIimS2VSnEL5/rtEH2XezP0nFybn9mnwr1ihZVor/L+Zu31nFaI7CvfIGbdLHFzpM PIAKY1Za6k3BgwGe8wGMr74k6vjnuSJbQtM4h1MTGsD82Mg9J7jm9rjEpGCXdrDrlyyXT+G+VQeWA Bh0phatnDkSP5w==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:55424 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mlIFN-0001UB-NQ; Thu, 11 Nov 2021 17:08:41 -0500 From: Ludovic =?utf-8?q?Court=C3=A8s?= References: <20211027135918.18833-1-ludo@gnu.org> <20211103132704.GA24459@triconium.com> Date: Thu, 11 Nov 2021 23:08:39 +0100 In-Reply-To: <20211103132704.GA24459@triconium.com> (David Aaron Fendley's message of "Wed, 3 Nov 2021 09:27:04 -0400") Message-ID: <878rxufiqg.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Hi David, David Aaron Fendley skribis: > If I have: > > (service static-networking-service-type > (list (static-networking > (addresses (list (network-address > (device "eno33559296") > (value "10.7.99.99/24")) > (network-address > (device "eno16780032") > (value "10.10.199.98/24")))) > (routes (list (network-route > (destination "default") > (gateway "10.10.199.1")) > (network-route > (destination "192.168.0.1/32") > (gateway "10.10.199.1")))) > (name-servers '("10.10.199.17" "10.10.101.2"))))) > > After reconfigure and restart of the networking service, no routes > listed are created. Only the standard routes for each network: Hmm right, I need to investigate this one some more. Apparently the ‘route-add’ call leads to “Network is unreachable”. [...] > If I then change the config to: > > (service static-networking-service-type > (list (static-networking > (addresses (list (network-address > (device "eno33559296") > (value "10.0.7.15/24")) > (network-address > (device "eno16780032") > (value "10.10.2.15/24")))) > (routes (list (network-route > (destination "default") > (gateway "10.0.2.2")))) > (name-servers '("10.0.2.3"))))) > > > > After reconfigure and restart of the networking service, routes > specified are still not created, and the addresses and routes are > appended: This one is fixed by the patch below: the ‘stop’ method of the service would not actually load the “tear-down-network” file, oops! Thanks a lot for testing and reporting! To be continued… Ludo’. diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 66683f153f..3123122200 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -2511,7 +2511,7 @@ (define network-set-up/linux addresses) #$@(map (match-lambda (($ name type arguments) - #~(link-add #:device #$name #$type + #~(link-add #$name #$type #:type-args '#$arguments))) links) #$@(map (lambda (route) @@ -2530,7 +2530,7 @@ (define network-set-up/linux (define network-tear-down/linux (match-lambda (($ addresses links routes) - (scheme-file "set-up-network" + (scheme-file "tear-down-network" (with-extensions (list guile-netlink) #~(begin (use-modules (ip addr) (ip link) (ip route)) @@ -2579,10 +2579,10 @@ (define (static-networking-shepherd-service config) (network-set-up/hurd config)))))) (stop #~(lambda _ ;; Return #f is successfully stopped. - #$(let-system (system target) - (if (string-contains (or target system) "-linux") - (network-tear-down/linux config) - (network-tear-down/hurd config))))) + (load #$(let-system (system target) + (if (string-contains (or target system) "-linux") + (network-tear-down/linux config) + (network-tear-down/hurd config)))))) (respawn? #f)))))) (define (static-networking-shepherd-services networks)