From patchwork Thu Apr 11 14:36:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Danny Milosavljevic X-Patchwork-Id: 3268 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 4447016E58; Thu, 11 Apr 2019 15:37:10 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id D890F16E56 for ; Thu, 11 Apr 2019 15:37:09 +0100 (BST) Received: from localhost ([127.0.0.1]:49969 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hEapB-0004rb-9G for patchwork@mira.cbaines.net; Thu, 11 Apr 2019 10:37:09 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34430) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hEap8-0004qv-Qa for guix-patches@gnu.org; Thu, 11 Apr 2019 10:37:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hEap6-0005yn-L2 for guix-patches@gnu.org; Thu, 11 Apr 2019 10:37:06 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:41462) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hEap4-0005xR-KN for guix-patches@gnu.org; Thu, 11 Apr 2019 10:37:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hEap4-0004Fh-FY for guix-patches@gnu.org; Thu, 11 Apr 2019 10:37:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#35229] [PATCH] gnu: docker: Check for error on XFRM. Resent-From: Danny Milosavljevic Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 11 Apr 2019 14:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 35229 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 35229@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.155499340516321 (code B ref -1); Thu, 11 Apr 2019 14:37:02 +0000 Received: (at submit) by debbugs.gnu.org; 11 Apr 2019 14:36:45 +0000 Received: from localhost ([127.0.0.1]:55006 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hEaom-0004FB-OJ for submit@debbugs.gnu.org; Thu, 11 Apr 2019 10:36:44 -0400 Received: from eggs.gnu.org ([209.51.188.92]:48150) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hEaok-0004Es-3d for submit@debbugs.gnu.org; Thu, 11 Apr 2019 10:36:42 -0400 Received: from lists.gnu.org ([209.51.188.17]:42208) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hEaoe-0005ab-UM for submit@debbugs.gnu.org; Thu, 11 Apr 2019 10:36:36 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34297) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hEaod-0004eS-Ps for guix-patches@gnu.org; Thu, 11 Apr 2019 10:36:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hEaoc-0005Zs-P8 for guix-patches@gnu.org; Thu, 11 Apr 2019 10:36:35 -0400 Received: from dd26836.kasserver.com ([85.13.145.193]:36514) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hEaoc-0005YC-Hl for guix-patches@gnu.org; Thu, 11 Apr 2019 10:36:34 -0400 Received: from dayas.3.home (77.117.177.161.wireless.dyn.drei.com [77.117.177.161]) by dd26836.kasserver.com (Postfix) with ESMTPSA id 06CFF3360DD9; Thu, 11 Apr 2019 16:36:30 +0200 (CEST) From: Danny Milosavljevic Date: Thu, 11 Apr 2019 16:36:28 +0200 Message-Id: <20190411143628.301-1-dannym@scratchpost.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Tags: patch X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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 * gnu/packages/patches/docker-use-fewer-modprobes.patch: Check for error on XFRM. --- .../patches/docker-use-fewer-modprobes.patch | 30 +++++++++++++++---- 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/gnu/packages/patches/docker-use-fewer-modprobes.patch b/gnu/packages/patches/docker-use-fewer-modprobes.patch index 2779e1be5d..4e4a45b6ce 100644 --- a/gnu/packages/patches/docker-use-fewer-modprobes.patch +++ b/gnu/packages/patches/docker-use-fewer-modprobes.patch @@ -103,17 +103,35 @@ See . --- docker-18.09.0-checkout/vendor/github.com/docker/libnetwork/ns/init_linux.go.orig 2019-03-19 11:23:20.738316699 +0100 +++ docker-18.09.0-checkout/vendor/github.com/docker/libnetwork/ns/init_linux.go 2019-03-19 11:27:57.149753073 +0100 -@@ -100,12 +100,7 @@ +@@ -76,12 +76,8 @@ func NlHandle() *netlink.Handle { + func getSupportedNlFamilies() []int { + fams := []int{syscall.NETLINK_ROUTE} + // NETLINK_XFRM test +- if err := loadXfrmModules(); err != nil { +- if checkXfrmSocket() != nil { +- logrus.Warnf("Could not load necessary modules for IPSEC rules: %v", err) +- } else { +- fams = append(fams, syscall.NETLINK_XFRM) +- } ++ if err := checkXfrmSocket(); err != nil { ++ logrus.Warnf("Could not load necessary modules for IPSEC rules: %v", err) + } else { + fams = append(fams, syscall.NETLINK_XFRM) + } +@@ -99,16 +95,6 @@ func getSupportedNlFamilies() []int { + return fams } - func loadXfrmModules() error { +-func loadXfrmModules() error { - if out, err := exec.Command("modprobe", "-va", "xfrm_user").CombinedOutput(); err != nil { - return fmt.Errorf("Running modprobe xfrm_user failed with message: `%s`, error: %v", strings.TrimSpace(string(out)), err) - } - if out, err := exec.Command("modprobe", "-va", "xfrm_algo").CombinedOutput(); err != nil { - return fmt.Errorf("Running modprobe xfrm_algo failed with message: `%s`, error: %v", strings.TrimSpace(string(out)), err) - } -+ // Those are automatically loaded when someone opens the socket anyway. - return nil - } - +- return nil +-} +- + // API check on required xfrm modules (xfrm_user, xfrm_algo) + func checkXfrmSocket() error { + fd, err := syscall.Socket(syscall.AF_NETLINK, syscall.SOCK_RAW, syscall.NETLINK_XFRM)