From: Danny Milosavljevic <dannym@scratchpost.org>
To: 35229@debbugs.gnu.org
Subject: [bug#35229] [PATCH] gnu: docker: Check for error on XFRM.
Date: Thu, 11 Apr 2019 16:36:28 +0200 [thread overview]
Message-ID: <20190411143628.301-1-dannym@scratchpost.org> (raw)
* 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 <https://github.com/moby/moby/pull/38930>.
--- 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)
next reply other threads:[~2019-04-11 14:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-11 14:36 Danny Milosavljevic [this message]
2019-04-14 15:16 ` [bug#35229] [PATCH] gnu: docker: Check for error on XFRM Ludovic Courtès
2019-04-14 17:05 ` bug#35229: " Danny Milosavljevic
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190411143628.301-1-dannym@scratchpost.org \
--to=dannym@scratchpost.org \
--cc=35229@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).