aboutsummaryrefslogtreecommitdiffstats
path: root/community/docker/netns-mips64-fork.patch
blob: 8703beb681e3ea24fce996f1a74edfa1809f687e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
diff --git a/components/cli/vendor/github.com/docker/docker/vendor.conf b/components/cli/vendor/github.com/docker/docker/vendor.conf
index 6b4df60..581eb63 100644
--- a/components/cli/vendor/github.com/docker/docker/vendor.conf
+++ b/components/cli/vendor/github.com/docker/docker/vendor.conf
@@ -50,7 +50,7 @@ github.com/hashicorp/go-sockaddr                    6d291a969b86c4b633730bfc6b8b
 github.com/hashicorp/go-multierror                  fcdddc395df1ddf4247c69bd436e84cfa0733f7e
 github.com/hashicorp/serf                           598c54895cc5a7b1a24a398d635e8c0ea0959870
 github.com/docker/libkv                             458977154600b9f23984d9f4b82e79570b5ae12b
-github.com/vishvananda/netns                        604eaf189ee867d8c147fafc28def2394e878d25
+github.com/jwh/netns                                efc5872c2d476c2ff4e40ce79497146e9af02bab
 github.com/vishvananda/netlink                      b2de5d10e38ecce8607e6b438b6d174f389a004e
 
 # When updating, consider updating TOMLV_COMMIT in hack/dockerfile/install/tomlv.installer accordingly
diff --git a/components/cli/vendor/github.com/moby/buildkit/go.mod b/components/cli/vendor/github.com/moby/buildkit/go.mod
index 0d238c7..41af3ed 100644
--- a/components/cli/vendor/github.com/moby/buildkit/go.mod
+++ b/components/cli/vendor/github.com/moby/buildkit/go.mod
@@ -59,7 +59,7 @@ require (
 	github.com/uber/jaeger-lib v1.2.1 // indirect
 	github.com/urfave/cli v0.0.0-20171014202726-7bc6a0acffa5
 	github.com/vishvananda/netlink v1.0.0 // indirect
-	github.com/vishvananda/netns v0.0.0-20180720170159-13995c7128cc // indirect
+	github.com/jwh/netns v0.0.0-20180720170159-13995c7128cc // indirect
 	go.etcd.io/bbolt v1.3.2
 	golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2
 	golang.org/x/net v0.0.0-20190311183353-d8887717615a
diff --git a/components/engine/vendor.conf b/components/engine/vendor.conf
index 8d1b34d..1cf4256 100644
--- a/components/engine/vendor.conf
+++ b/components/engine/vendor.conf
@@ -50,7 +50,7 @@ github.com/hashicorp/go-sockaddr                    c7188e74f6acae5a989bdc959aa7
 github.com/hashicorp/go-multierror                  886a7fbe3eb1c874d46f623bfa70af45f425b3d1 # v1.0.0
 github.com/hashicorp/serf                           598c54895cc5a7b1a24a398d635e8c0ea0959870
 github.com/docker/libkv                             458977154600b9f23984d9f4b82e79570b5ae12b
-github.com/vishvananda/netns                        7109fa855b0ff1ebef7fbd2f6aa613e8db7cfbc0
+github.com/jwh/netns                        efc5872c2d476c2ff4e40ce79497146e9af02bab
 github.com/vishvananda/netlink                      a2ad57a690f3caf3015351d2d6e1c0b95c349752
 
 # When updating, consider updating TOMLV_COMMIT in hack/dockerfile/install/tomlv.installer accordingly
diff --git a/components/engine/vendor/github.com/docker/libnetwork/drivers/overlay/ov_network.go b/components/engine/vendor/github.com/docker/libnetwork/drivers/overlay/ov_network.go
index 4009df8..05473db 100644
--- a/components/engine/vendor/github.com/docker/libnetwork/drivers/overlay/ov_network.go
+++ b/components/engine/vendor/github.com/docker/libnetwork/drivers/overlay/ov_network.go
@@ -25,7 +25,7 @@ import (
 	"github.com/sirupsen/logrus"
 	"github.com/vishvananda/netlink"
 	"github.com/vishvananda/netlink/nl"
-	"github.com/vishvananda/netns"
+	"github.com/jwh/netns"
 	"golang.org/x/sys/unix"
 )
 
diff --git a/components/engine/vendor/github.com/docker/libnetwork/drivers/overlay/ov_utils.go b/components/engine/vendor/github.com/docker/libnetwork/drivers/overlay/ov_utils.go
index 7338ea9..f020016 100644
--- a/components/engine/vendor/github.com/docker/libnetwork/drivers/overlay/ov_utils.go
+++ b/components/engine/vendor/github.com/docker/libnetwork/drivers/overlay/ov_utils.go
@@ -11,7 +11,7 @@ import (
 	"github.com/docker/libnetwork/osl"
 	"github.com/sirupsen/logrus"
 	"github.com/vishvananda/netlink"
-	"github.com/vishvananda/netns"
+	"github.com/jwh/netns"
 )
 
 var soTimeout = ns.NetlinkSocketsTimeout
diff --git a/components/engine/vendor/github.com/docker/libnetwork/ipvs/ipvs.go b/components/engine/vendor/github.com/docker/libnetwork/ipvs/ipvs.go
index 61b6f0a..46d635f 100644
--- a/components/engine/vendor/github.com/docker/libnetwork/ipvs/ipvs.go
+++ b/components/engine/vendor/github.com/docker/libnetwork/ipvs/ipvs.go
@@ -8,7 +8,7 @@ import (
 	"time"
 
 	"github.com/vishvananda/netlink/nl"
-	"github.com/vishvananda/netns"
+	"github.com/jwh/netns"
 	"golang.org/x/sys/unix"
 )
 
diff --git a/components/engine/vendor/github.com/docker/libnetwork/ipvs/netlink.go b/components/engine/vendor/github.com/docker/libnetwork/ipvs/netlink.go
index 7673659..950046c 100644
--- a/components/engine/vendor/github.com/docker/libnetwork/ipvs/netlink.go
+++ b/components/engine/vendor/github.com/docker/libnetwork/ipvs/netlink.go
@@ -17,7 +17,7 @@ import (
 
 	"github.com/sirupsen/logrus"
 	"github.com/vishvananda/netlink/nl"
-	"github.com/vishvananda/netns"
+	"github.com/jwh/netns"
 )
 
 // For Quick Reference IPVS related netlink message is described at the end of this file.
diff --git a/components/engine/vendor/github.com/docker/libnetwork/ns/init_linux.go b/components/engine/vendor/github.com/docker/libnetwork/ns/init_linux.go
index 1d08a02..e3c7ff3 100644
--- a/components/engine/vendor/github.com/docker/libnetwork/ns/init_linux.go
+++ b/components/engine/vendor/github.com/docker/libnetwork/ns/init_linux.go
@@ -11,7 +11,7 @@ import (
 
 	"github.com/sirupsen/logrus"
 	"github.com/vishvananda/netlink"
-	"github.com/vishvananda/netns"
+	"github.com/jwh/netns"
 )
 
 var (
diff --git a/components/engine/vendor/github.com/docker/libnetwork/osl/interface_linux.go b/components/engine/vendor/github.com/docker/libnetwork/osl/interface_linux.go
index 4f8ff3d..11d79b0 100644
--- a/components/engine/vendor/github.com/docker/libnetwork/osl/interface_linux.go
+++ b/components/engine/vendor/github.com/docker/libnetwork/osl/interface_linux.go
@@ -12,7 +12,7 @@ import (
 	"github.com/docker/libnetwork/types"
 	"github.com/sirupsen/logrus"
 	"github.com/vishvananda/netlink"
-	"github.com/vishvananda/netns"
+	"github.com/jwh/netns"
 )
 
 // IfaceOption is a function option type to set interface options
diff --git a/components/engine/vendor/github.com/docker/libnetwork/osl/namespace_linux.go b/components/engine/vendor/github.com/docker/libnetwork/osl/namespace_linux.go
index ed44311..cfa675b 100644
--- a/components/engine/vendor/github.com/docker/libnetwork/osl/namespace_linux.go
+++ b/components/engine/vendor/github.com/docker/libnetwork/osl/namespace_linux.go
@@ -20,7 +20,7 @@ import (
 	"github.com/docker/libnetwork/types"
 	"github.com/sirupsen/logrus"
 	"github.com/vishvananda/netlink"
-	"github.com/vishvananda/netns"
+	"github.com/jwh/netns"
 )
 
 const defaultPrefix = "/var/run/docker"
diff --git a/components/engine/vendor/github.com/docker/libnetwork/resolver_unix.go b/components/engine/vendor/github.com/docker/libnetwork/resolver_unix.go
index f4e4ad6..d27a64d 100644
--- a/components/engine/vendor/github.com/docker/libnetwork/resolver_unix.go
+++ b/components/engine/vendor/github.com/docker/libnetwork/resolver_unix.go
@@ -12,7 +12,7 @@ import (
 	"github.com/docker/docker/pkg/reexec"
 	"github.com/docker/libnetwork/iptables"
 	"github.com/sirupsen/logrus"
-	"github.com/vishvananda/netns"
+	"github.com/jwh/netns"
 )
 
 func init() {
diff --git a/components/engine/vendor/github.com/docker/libnetwork/service_linux.go b/components/engine/vendor/github.com/docker/libnetwork/service_linux.go
index 451f760..7dcbddf 100644
--- a/components/engine/vendor/github.com/docker/libnetwork/service_linux.go
+++ b/components/engine/vendor/github.com/docker/libnetwork/service_linux.go
@@ -22,7 +22,7 @@ import (
 	"github.com/ishidawataru/sctp"
 	"github.com/sirupsen/logrus"
 	"github.com/vishvananda/netlink/nl"
-	"github.com/vishvananda/netns"
+	"github.com/jwh/netns"
 )
 
 func init() {
diff --git a/components/engine/vendor/github.com/docker/libnetwork/vendor.conf b/components/engine/vendor/github.com/docker/libnetwork/vendor.conf
index 78b8379..a125199 100644
--- a/components/engine/vendor/github.com/docker/libnetwork/vendor.conf
+++ b/components/engine/vendor/github.com/docker/libnetwork/vendor.conf
@@ -43,7 +43,7 @@ github.com/samuel/go-zookeeper          d0e0d8e11f318e000a8cc434616d69e329edc374
 github.com/sirupsen/logrus              f006c2ac4710855cf0f916dd6b77acf6b048dc6e # v1.0.3
 github.com/ugorji/go                    b4c50a2b199d93b13dc15e78929cfb23bfdf21ab # v1.1.1
 github.com/vishvananda/netlink          a2ad57a690f3caf3015351d2d6e1c0b95c349752 # v1.0.0
-github.com/vishvananda/netns            7109fa855b0ff1ebef7fbd2f6aa613e8db7cfbc0
+github.com/jwh/netns            efc5872c2d476c2ff4e40ce79497146e9af02bab
 golang.org/x/crypto                     b7391e95e576cacdcdd422573063bc057239113d
 golang.org/x/net                        a680a1efc54dd51c040b3b5ce4939ea3cf2ea0d1
 golang.org/x/sys                        d455e41777fca6e8a5a79e34a14b8368bc11d9ba
diff --git a/components/engine/vendor/github.com/vishvananda/netns/LICENSE b/components/engine/vendor/github.com/jwh/netns/LICENSE
similarity index 100%
rename from components/engine/vendor/github.com/vishvananda/netns/LICENSE
rename to components/engine/vendor/github.com/jwh/netns/LICENSE
diff --git a/components/engine/vendor/github.com/vishvananda/netns/README.md b/components/engine/vendor/github.com/jwh/netns/README.md
similarity index 88%
rename from components/engine/vendor/github.com/vishvananda/netns/README.md
rename to components/engine/vendor/github.com/jwh/netns/README.md
index 6b45cfb..61e3ee4 100644
--- a/components/engine/vendor/github.com/vishvananda/netns/README.md
+++ b/components/engine/vendor/github.com/jwh/netns/README.md
@@ -8,11 +8,11 @@ privileges, so in most cases this code needs to be run as root.
 
 You can use go get command:
 
-    go get github.com/vishvananda/netns
+    go get github.com/jwh/netns
 
 Testing (requires root):
 
-    sudo -E go test github.com/vishvananda/netns
+    sudo -E go test github.com/jwh/netns
 
 ## Example ##
 
@@ -23,7 +23,7 @@ import (
     "fmt"
     "net"
     "runtime"
-    "github.com/vishvananda/netns"
+    "github.com/jwh/netns"
 )
 
 func main() {
diff --git a/components/engine/vendor/github.com/jwh/netns/go.mod b/components/engine/vendor/github.com/jwh/netns/go.mod
new file mode 100644
index 0000000..d6aabc4
--- /dev/null
+++ b/components/engine/vendor/github.com/jwh/netns/go.mod
@@ -0,0 +1,3 @@
+module github.com/jwh/netns
+
+go 1.12
diff --git a/components/engine/vendor/github.com/jwh/netns/go.sum b/components/engine/vendor/github.com/jwh/netns/go.sum
new file mode 100644
index 0000000..e69de29
diff --git a/components/engine/vendor/github.com/vishvananda/netns/netns.go b/components/engine/vendor/github.com/jwh/netns/netns.go
similarity index 100%
rename from components/engine/vendor/github.com/vishvananda/netns/netns.go
rename to components/engine/vendor/github.com/jwh/netns/netns.go
diff --git a/components/engine/vendor/github.com/vishvananda/netns/netns_linux.go b/components/engine/vendor/github.com/jwh/netns/netns_linux.go
similarity index 98%
rename from components/engine/vendor/github.com/vishvananda/netns/netns_linux.go
rename to components/engine/vendor/github.com/jwh/netns/netns_linux.go
index b1e3b07..66b5c1c 100644
--- a/components/engine/vendor/github.com/vishvananda/netns/netns_linux.go
+++ b/components/engine/vendor/github.com/jwh/netns/netns_linux.go
@@ -19,9 +19,10 @@ var SYS_SETNS = map[string]uintptr{
 	"amd64":   308,
 	"arm64":   268,
 	"arm":     375,
-	"mips":    4344,
-	"mipsle":  4344,
-	"mips64le":  4344,
+	"mips":    5303,
+	"mipsle":  5303,
+	"mips64":  5303,
+	"mips64le":  5303,
 	"ppc64":   350,
 	"ppc64le": 350,
 	"riscv64": 268,
diff --git a/components/engine/vendor/github.com/jwh/netns/netns_test.go b/components/engine/vendor/github.com/jwh/netns/netns_test.go
new file mode 100644
index 0000000..e51981c
--- /dev/null
+++ b/components/engine/vendor/github.com/jwh/netns/netns_test.go
@@ -0,0 +1,66 @@
+package netns
+
+import (
+	"runtime"
+	"sync"
+	"testing"
+)
+
+func TestGetNewSetDelete(t *testing.T) {
+	runtime.LockOSThread()
+	defer runtime.UnlockOSThread()
+
+	origns, err := Get()
+	if err != nil {
+		t.Fatal(err)
+	}
+	newns, err := New()
+	if err != nil {
+		t.Fatal(err)
+	}
+	if origns.Equal(newns) {
+		t.Fatal("New ns failed")
+	}
+	if err := Set(origns); err != nil {
+		t.Fatal(err)
+	}
+	newns.Close()
+	if newns.IsOpen() {
+		t.Fatal("newns still open after close", newns)
+	}
+	ns, err := Get()
+	if err != nil {
+		t.Fatal(err)
+	}
+	if !ns.Equal(origns) {
+		t.Fatal("Reset ns failed", origns, newns, ns)
+	}
+}
+
+func TestNone(t *testing.T) {
+	ns := None()
+	if ns.IsOpen() {
+		t.Fatal("None ns is open", ns)
+	}
+}
+
+func TestThreaded(t *testing.T) {
+	ncpu := runtime.GOMAXPROCS(-1)
+	if ncpu < 2 {
+		t.Skip("-cpu=2 or larger required")
+	}
+
+	// Lock this thread simply to ensure other threads get used.
+	runtime.LockOSThread()
+	defer runtime.UnlockOSThread()
+
+	wg := &sync.WaitGroup{}
+	for i := 0; i < ncpu; i++ {
+		wg.Add(1)
+		go func() {
+			defer wg.Done()
+			TestGetNewSetDelete(t)
+		}()
+	}
+	wg.Wait()
+}
diff --git a/components/engine/vendor/github.com/vishvananda/netns/netns_unspecified.go b/components/engine/vendor/github.com/jwh/netns/netns_unspecified.go
similarity index 100%
rename from components/engine/vendor/github.com/vishvananda/netns/netns_unspecified.go
rename to components/engine/vendor/github.com/jwh/netns/netns_unspecified.go
diff --git a/components/engine/vendor/github.com/moby/buildkit/go.mod b/components/engine/vendor/github.com/moby/buildkit/go.mod
index cf1c7d6..c501e9d 100644
--- a/components/engine/vendor/github.com/moby/buildkit/go.mod
+++ b/components/engine/vendor/github.com/moby/buildkit/go.mod
@@ -60,7 +60,7 @@ require (
 	github.com/uber/jaeger-lib v1.2.1 // indirect
 	github.com/urfave/cli v0.0.0-20171014202726-7bc6a0acffa5
 	github.com/vishvananda/netlink v1.0.0 // indirect
-	github.com/vishvananda/netns v0.0.0-20180720170159-13995c7128cc // indirect
+	github.com/jwh/netns v0.0.0-20180720170159-13995c7128cc // indirect
 	go.etcd.io/bbolt v1.3.2
 	golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2
 	golang.org/x/net v0.0.0-20190311183353-d8887717615a
diff --git a/components/engine/vendor/github.com/vishvananda/netlink/README.md b/components/engine/vendor/github.com/vishvananda/netlink/README.md
index a88e2f4..863594a 100644
--- a/components/engine/vendor/github.com/vishvananda/netlink/README.md
+++ b/components/engine/vendor/github.com/vishvananda/netlink/README.md
@@ -24,7 +24,7 @@ You can use go get command:
 
 Testing dependencies:
 
-    go get github.com/vishvananda/netns
+    go get github.com/jwh/netns
 
 Testing (requires root):
 
diff --git a/components/engine/vendor/github.com/vishvananda/netlink/addr_linux.go b/components/engine/vendor/github.com/vishvananda/netlink/addr_linux.go
index d59c328..757b58b 100644
--- a/components/engine/vendor/github.com/vishvananda/netlink/addr_linux.go
+++ b/components/engine/vendor/github.com/vishvananda/netlink/addr_linux.go
@@ -7,7 +7,7 @@ import (
 	"syscall"
 
 	"github.com/vishvananda/netlink/nl"
-	"github.com/vishvananda/netns"
+	"github.com/jwh/netns"
 	"golang.org/x/sys/unix"
 )
 
diff --git a/components/engine/vendor/github.com/vishvananda/netlink/handle_linux.go b/components/engine/vendor/github.com/vishvananda/netlink/handle_linux.go
index 9f6d7fe..1485a95 100644
--- a/components/engine/vendor/github.com/vishvananda/netlink/handle_linux.go
+++ b/components/engine/vendor/github.com/vishvananda/netlink/handle_linux.go
@@ -5,7 +5,7 @@ import (
 	"time"
 
 	"github.com/vishvananda/netlink/nl"
-	"github.com/vishvananda/netns"
+	"github.com/jwh/netns"
 	"golang.org/x/sys/unix"
 )
 
diff --git a/components/engine/vendor/github.com/vishvananda/netlink/handle_unspecified.go b/components/engine/vendor/github.com/vishvananda/netlink/handle_unspecified.go
index 915b765..8fc0363 100644
--- a/components/engine/vendor/github.com/vishvananda/netlink/handle_unspecified.go
+++ b/components/engine/vendor/github.com/vishvananda/netlink/handle_unspecified.go
@@ -6,7 +6,7 @@ import (
 	"net"
 	"time"
 
-	"github.com/vishvananda/netns"
+	"github.com/jwh/netns"
 )
 
 type Handle struct{}
diff --git a/components/engine/vendor/github.com/vishvananda/netlink/link_linux.go b/components/engine/vendor/github.com/vishvananda/netlink/link_linux.go
index 540191e..da86410 100644
--- a/components/engine/vendor/github.com/vishvananda/netlink/link_linux.go
+++ b/components/engine/vendor/github.com/vishvananda/netlink/link_linux.go
@@ -10,7 +10,7 @@ import (
 	"unsafe"
 
 	"github.com/vishvananda/netlink/nl"
-	"github.com/vishvananda/netns"
+	"github.com/jwh/netns"
 	"golang.org/x/sys/unix"
 )
 
diff --git a/components/engine/vendor/github.com/vishvananda/netlink/nl/nl_linux.go b/components/engine/vendor/github.com/vishvananda/netlink/nl/nl_linux.go
index bc8e82c..f2ffeb1 100644
--- a/components/engine/vendor/github.com/vishvananda/netlink/nl/nl_linux.go
+++ b/components/engine/vendor/github.com/vishvananda/netlink/nl/nl_linux.go
@@ -12,7 +12,7 @@ import (
 	"syscall"
 	"unsafe"
 
-	"github.com/vishvananda/netns"
+	"github.com/jwh/netns"
 	"golang.org/x/sys/unix"
 )
 
diff --git a/components/engine/vendor/github.com/vishvananda/netlink/route_linux.go b/components/engine/vendor/github.com/vishvananda/netlink/route_linux.go
index 3f85671..177002f 100644
--- a/components/engine/vendor/github.com/vishvananda/netlink/route_linux.go
+++ b/components/engine/vendor/github.com/vishvananda/netlink/route_linux.go
@@ -7,7 +7,7 @@ import (
 	"syscall"
 
 	"github.com/vishvananda/netlink/nl"
-	"github.com/vishvananda/netns"
+	"github.com/jwh/netns"
 	"golang.org/x/sys/unix"
 )
 
diff --git a/components/engine/vendor/github.com/vishvananda/netlink/xfrm_monitor_linux.go b/components/engine/vendor/github.com/vishvananda/netlink/xfrm_monitor_linux.go
index efe72dd..42ae754 100644
--- a/components/engine/vendor/github.com/vishvananda/netlink/xfrm_monitor_linux.go
+++ b/components/engine/vendor/github.com/vishvananda/netlink/xfrm_monitor_linux.go
@@ -4,7 +4,7 @@ import (
 	"fmt"
 
 	"github.com/vishvananda/netlink/nl"
-	"github.com/vishvananda/netns"
+	"github.com/jwh/netns"
 	"golang.org/x/sys/unix"
 )