Commit graph

2583 commits

Author SHA1 Message Date
yalpul
967ec6f2e8 Fix typo in macvlan_setup.go
Signed-off-by: yalpul <yalpul@gmail.com>
2021-06-19 11:36:16 +03:00
Sebastiaan van Stijn
ff141d366f
netutils: minor cleanups
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-06-17 10:49:48 +02:00
Sebastiaan van Stijn
888e75dfc9
netutils: remove unused ErrNoDefaultRoute
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-06-17 10:49:45 +02:00
Sebastiaan van Stijn
c21eaf9a07
portmapper: move mockProxyCommand to a _test file
No need to vendor this file in other projects, and it's only
used during tests.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-06-17 10:27:34 +02:00
Sebastiaan van Stijn
ac8c80d6f1
portmapper: change userlandProxyCommandName to a const
it's not overridden anywhere, so may as well be a const

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-06-17 10:27:33 +02:00
Sebastiaan van Stijn
f6be7f2945
portmapper: minor linting fix, and comment purpose of newProxy variable
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-06-17 10:27:31 +02:00
Sebastiaan van Stijn
4231dbca23
portmapper: don't compile linux-only code on Windows
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-06-17 10:27:29 +02:00
Akihiro Suda
5e62ca1a05
Merge pull request #42504 from thaJeztah/portallocator_cleanup 2021-06-13 06:10:10 +09:00
Akihiro Suda
342dfb3521
Merge pull request #42505 from thaJeztah/endpoint_deadcode 2021-06-13 03:07:03 +09:00
Sebastiaan van Stijn
76640e5d39
drivers/bridge: format comments
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-06-10 18:06:07 +02:00
Sebastiaan van Stijn
da0a006b14
drivers/bridge: dont use types.ParseCIDR() for fixed value
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-06-10 18:06:04 +02:00
Sebastiaan van Stijn
31d3468146
windows: remove redundant init()
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-06-10 18:00:00 +02:00
Justin Cormack
9459423e31
Merge pull request #42503 from thaJeztah/bridge_redundant_list
libnetwork/bridge: remove unused "others" argument from isolateNetwork()
2021-06-10 10:51:19 +01:00
Sebastiaan van Stijn
c7b1e5ba38
portallocator: log instead of discard port-range failures
Both getDynamicPortRange() and sanitizePortRange() could produce
and error, and the error message was currently discarded, silently
falling back to using the default port range.

This patch:

- Moves the fallback message from getDynamicPortRange() to getDefaultPortRange(),
  which is where the actual fallback occurs.
- Logs the fallback message and the error that causes the fallback.

The message/error is currently printed at the INFO level, but could be raised
to a WARN, depending on what kind of situations can cause the error.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-06-10 10:52:59 +02:00
Sebastiaan van Stijn
1f398f06aa
portallocator: minor refactor for readability
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-06-10 10:52:57 +02:00
Sebastiaan van Stijn
1f90fdd973
portallocator: use const for default port-ranges, instead of init()
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-06-10 10:52:49 +02:00
Sebastiaan van Stijn
350e303c7f endpoint: remove redundant doUpdateHostsFile() function
The second (sandbox) argument was unused, and it was only
used in a single location, so we may as well inline the
check.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-06-09 22:38:34 +02:00
Sebastiaan van Stijn
508a0979d9
bridge: remove unused "others" argument from isolateNetwork()
This argument was used to detect conflicts, but was later removed in
1c73b1c99c14d7f048a2318a3caf589865c76fad.

However, it was never removed, and we were still getting a list
of all networks, without using the results.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-06-09 22:23:38 +02:00
Sebastiaan van Stijn
117bca149f
libnetwork/resolver: fix minor linting issues
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-06-09 19:37:10 +02:00
Sebastiaan van Stijn
774b970cb1
libnetwork: remove MAINTAINERS and LICENSE
There's already a copy of the Apache license at the root of the
repository.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-06-09 12:37:45 +02:00
Sebastiaan van Stijn
e90d6abfcd
libnetwork: update Dockerfile to Go 1.13.15
Also adds other build-args to match the main Dockerfile

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-06-09 12:34:01 +02:00
Sebastiaan van Stijn
a384f83e7a
libnetwork: remove CircleCI config and code
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-06-09 12:31:52 +02:00
Sebastiaan van Stijn
9f6add406e
networkdb: mark test-helpers as t.Helper()
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-06-09 01:44:46 +02:00
Sebastiaan van Stijn
a7ecbd4b29
libnetwork: replace BurntSushi/toml with pelletier/go-toml
The BurntSushi project is no longer maintained, and the container ecosystem
is moving to use the pelletier/go-toml project instead.

This patch moves libnetwork to use the pelletier/go-toml library, to reduce
our dependency tree and use the same library in all places.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-06-05 00:53:49 +02:00
Brian Goff
0dd8bc6d31 Fix flakey test TestNetworkDBIslands
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2021-06-02 16:53:29 +00:00
Brian Goff
b3c883bb2f Skip libnetwork integration tests on Windows
Most of these tests are making use of the bridge network and do not work
on Windows.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2021-06-02 16:53:29 +00:00
Brian Goff
7186fd8a95 More libnetwork windows test fixes
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2021-06-02 16:53:24 +00:00
Brian Goff
4b981436fe Fixup libnetwork lint errors
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2021-06-01 23:48:32 +00:00
Brian Goff
b53b85ca40 Remove libnetwork leftover vendor stuff
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2021-06-01 23:48:32 +00:00
Brian Goff
00b2c13a1b Fix some windows issues in libnetwork tests
Fix build constraints for linux-only network drivers

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2021-06-01 23:48:23 +00:00
Brian Goff
20fd1dd7d2 Skip some windows network driver tests
These are failing in CI because something is not enabled.
Its not clear that these tests ever worked because they were not
actually running while in the libnetwork repo, which was only testing
Linux.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2021-06-01 22:15:10 +00:00
Brian Goff
72c4a7b496 Fix issues running libnetwork tests.
libnetwork does different stuff depending on if you are running the
tests in a container or not... without telling it we are in a container
a bunch of the tests actually fail.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2021-06-01 22:14:41 +00:00
Brian Goff
a0a473125b Fix libnetwork imports
After moving libnetwork to this repo, we need to update all the import
paths for libnetwork to point to docker/docker/libnetwork instead of
docker/libnetwork.
This change implements that.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2021-06-01 21:51:23 +00:00
Sebastiaan van Stijn
c1437c2f42 Merge pull request #2635 from AkihiroSuda/ipv6disable
fix port forwarding with ipv6.disable=1
2021-05-25 11:06:46 +02:00
Sebastiaan van Stijn
719504b810 vendor: github.com/ishidawataru/sctp f2269e66cdee387bd321445d5d300893449805be
full diff: 6e2cb13661...f2269e66cd

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-05-19 14:11:08 +02:00
Akihiro Suda
325668315c fix port forwarding with ipv6.disable=1
Make `docker run -p 80:80` functional again on environments with kernel boot parameter `ipv6.disable=1`.

Fix moby/moby issue 42288

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2021-04-27 15:46:07 +09:00
Francesco Degrassi
f41a6d5c95 enforce order of lock acquisitions on network/controller, fixes #2632
Signed-off-by: Francesco Degrassi <francesco.degrassi@optionfactory.net>
2021-04-21 15:51:31 +02:00
Arko Dasgupta
5d3b0102f7 Use hostIP to decide on Portmapper version
Use HostIP to decide which portmapper object to store the binding
in consistently in the allocate and release method (b506539e9c/drivers/bridge/port_mapping.go (L208))

Signed-off-by: Arko Dasgupta <arko.dasgupta@docker.com>
2021-01-23 12:00:46 -08:00
Arko Dasgupta
b506539e9c Merge pull request #2608 from arkodg/allow-ipv6-ipv4-userland-proxy
Fix regression in docker-proxy
2021-01-19 09:48:41 -08:00
Arko Dasgupta
4f9af99194 Fix regression in docker-proxy
Allow proxying IPv6 traffic to the container's IPv4 interface
if `--ipv6` is disabled and the container does not have a
IPv6 address, when the docker-proxy / `userland-proxy` is enabled
on `dockerd`

Relates to https://github.com/moby/libnetwork/issues/2607

Signed-off-by: Arko Dasgupta <arko.dasgupta@docker.com>
2021-01-14 17:51:09 -08:00
Benjamin Böhmke
a6d7b43dfc fixed IPv6 iptables rules for enabled firewalld
Signed-off-by: Benjamin Böhmke <benjamin@boehmke.net>
2021-01-07 17:46:32 +01:00
Arko Dasgupta
33a82a26a8 Fix IPv6 Port Forwarding for the Bridge Driver
1. Allocate either a IPv4 and/or IPv6 Port Binding (HostIP, HostPort, ContainerIP,
ContainerPort) based on the input and system parameters
2. Update the userland proxy as well as dummy proxy (inside port mapper) to
specifically listen on either the IPv4 or IPv6 network

Signed-off-by: Arko Dasgupta <arko.dasgupta@docker.com>
2020-12-14 18:46:22 -08:00
Arko Dasgupta
09be71b900 Merge pull request #2603 from bboehmke/ipv6_portmapper_chain
Fixed IPv6 portmapper iptables chain initialization
2020-12-11 10:39:35 -08:00
Arko Dasgupta
cf05dae77a Merge pull request #2600 from arkodg/fix-ipv6tables-panic
Make sure IPv6 is enabled for IP6tables
2020-12-11 10:20:38 -08:00
Benjamin Böhmke
06308f4d37 setup IPv4 and IPv6 iptables chain
Signed-off-by: Benjamin Böhmke <benjamin@boehmke.net>
2020-12-11 11:12:41 +01:00
Benjamin Böhmke
d14b7a5191 fixed ip6tables command in error message
Signed-off-by: Benjamin Böhmke <benjamin@boehmke.net>
2020-12-11 11:10:55 +01:00
Arko Dasgupta
b7c663c2ec Make sure IPv6 is enabled for IP6tables
Signed-off-by: Arko Dasgupta <arko.dasgupta@docker.com>
2020-12-11 00:39:42 -08:00
Benjamin Böhmke
4886e5e5b1 Added improved IP validation for port mapper
Signed-off-by: Benjamin Böhmke <benjamin@boehmke.net>
2020-11-20 23:03:35 +01:00
Sebastiaan van Stijn
5602e9b969 Merge pull request #2550 from fanjiyun/control-network-interface-order-for-containers
reduce parameters for func JoinOptionPriority
2020-10-31 19:02:54 +01:00
Sebastiaan van Stijn
fb9ecec127 Merge pull request #2585 from scottp-dpaw/lbendpoint_fix
service_linux: Fix null dereference in findLBEndpointSandbox
2020-10-31 18:31:17 +01:00
Arko Dasgupta
dc6cbb55b4 Merge pull request #2572 from bboehmke/ipv6_nat
Enable IPv6 NAT (rebase of #2023)
2020-10-29 14:13:58 -07:00
Scott Percival
959dfca7e6 service_linux: Fix null dereference in findLBEndpointSandbox
Signed-off-by: Scott Percival <scottp@lastyard.com>
2020-09-22 15:06:41 +08:00
Tibor Vass
20c88eb92f Merge pull request #2583 from thaJeztah/update_docker_alt
vendor: update docker to 7ca355652f and reduce dependency graph
2020-09-17 13:29:33 -07:00
Tibor Vass
32e231a258 Merge pull request #2560 from thaJeztah/remove_dead_code
types: remove some dead code
2020-09-17 13:22:34 -07:00
Tibor Vass
2d8f0b4f87 Merge pull request #2562 from thaJeztah/replace_pkg_homedir
client/mflag: remove use of docker/docker/pkg/homedir
2020-09-17 13:21:49 -07:00
Tibor Vass
1d903b1089 Merge pull request #2580 from thaJeztah/update_circleci
CircleCI: update to Docker 19.03.12, and enable BuildKit
2020-09-17 13:13:15 -07:00
Sebastiaan van Stijn
e9646aafa4 vendor: docker/docker 7ca355652f
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-09-12 03:22:57 +02:00
Sebastiaan van Stijn
b3b8f561f7 vendor: github.com/gogo/protobuf v1.3.1
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-09-12 03:22:55 +02:00
Sebastiaan van Stijn
77c68a7f6e vendor: golang.org/x/crypto 75b288015ac94e66e3d6715fb68a9b41bf046ec2
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-09-12 03:22:53 +02:00
Sebastiaan van Stijn
d321fc2f61 vendor: golang.org/x/sync cd5d95a43a6e21273425c7ae415d3df9ea832eeb
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-09-12 03:22:51 +02:00
Sebastiaan van Stijn
b14bf0e66e vendor: golang.org/x/sys ed371f2e16b4b305ee99df548828de367527b76b
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-09-12 03:22:48 +02:00
Sebastiaan van Stijn
3c90d159f8 vendor: golang.org/x/net ab34263943818b32f575efc978a3d24e80b04bd7
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-09-12 03:22:45 +02:00
Sebastiaan van Stijn
b95a3f1f23 vendor: github.com/coreos/etcd v3.3.12
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-09-12 03:22:43 +02:00
Sebastiaan van Stijn
5ce882207d vendor: runtime-spec v1.0.3-0.20200728170252-4d89ac9fbff6
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-09-12 03:22:41 +02:00
Sebastiaan van Stijn
64e852ee65 vendor github.com/Microsoft/hcsshim 9dcb42f100215f8d375b4a9265e5bba009217a85
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-09-12 03:22:39 +02:00
Sebastiaan van Stijn
0aad792f1d vendor: containerd/cgroups 318312a373405e5e91134d8063d04d59768a1bff
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-09-12 03:22:37 +02:00
Sebastiaan van Stijn
2fdc3e86b1 vendor: logrus v1.6.0
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-09-12 03:22:35 +02:00
Sebastiaan van Stijn
05701c485e vendor: go.etcd.io/bbolt v1.3.5
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-09-12 03:22:33 +02:00
Sebastiaan van Stijn
e11c7fe3ab vendor: vishvananda/netns db3c7e526aae966c4ccfa6c8189b693d6ac5d202
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-09-12 03:22:31 +02:00
Sebastiaan van Stijn
6cbe360e47 vendor: github.com/gorilla/mux v1.8.0
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-09-12 03:22:29 +02:00
Sebastiaan van Stijn
e18c7629c3 vendor: docker/go-events e31b211e4f1cd09aa76fe4ac244571fab96ae47f
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-09-12 03:22:25 +02:00
Sebastiaan van Stijn
3e1e9e878c vendor: gotest.tools v3.0.2
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-09-12 03:22:18 +02:00
Sebastiaan van Stijn
5186d9e1b1 vendor: github.com/pkg/errors v0.9.1
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-09-12 02:49:03 +02:00
Sebastiaan van Stijn
dc6e4d8881 replace github.com/docker/docker/locker with github.com/moby/locker
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-09-12 02:38:50 +02:00
Sebastiaan van Stijn
6796c2cc9b client/mflag: remove use of docker/docker/pkg/homedir
The homedir package was only used to print default values for
flags that contained paths inside the user's home-directory in
a slightly nicer way (replace `/users/home` with `~`).

Given that this is not critical, we can replace this with golang's
function, which does not depend on libcontainer.

There's still one use of the homedir package in docker/docker/opts,
which is used by the dnet binary (but only requires the homedir
package when running in rootless mode)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-09-12 02:38:48 +02:00
Sebastiaan van Stijn
681196c8f2 Remove dependency on github.com/docker/docker/opts
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-09-12 02:38:39 +02:00
Sebastiaan van Stijn
bf28003c99 Replace use of deprecated functions
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-09-12 01:49:42 +02:00
Sebastiaan van Stijn
0e8b02bac4 Makefile: enable BuildKit
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-09-11 16:39:51 +02:00
Sebastiaan van Stijn
53688d374e CircleCI: update to Docker 19.03.12
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-09-11 16:39:34 +02:00
Sebastiaan van Stijn
6dde6cb0b0 drivers/macvlan: skip kernel version check
All distros that are supported by Docker now have at least
kernel version 3.10, so this check should no longer be needed.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-08-31 20:45:02 +02:00
Sebastiaan van Stijn
02d313ca15 drivers/bridge: skip kernel version check
All distros that are supported by Docker now have at least
kernel version 3.10, so this check should no longer be needed.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-08-31 20:44:51 +02:00
Sebastiaan van Stijn
304bb14ffc vendor.conf: reformat to match spacing in docker/docker
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-08-31 20:00:11 +02:00
Benjamin Böhmke
34f4706174 added TODOs for open IPv6 point
Signed-off-by: Benjamin Böhmke <benjamin@boehmke.net>
2020-07-23 16:52:40 +02:00
Benjamin Böhmke
648d891827 reworked allocatePorts
Signed-off-by: Benjamin Böhmke <benjamin@boehmke.net>
2020-07-22 15:43:02 +02:00
Benjamin Böhmke
9f98bd79d8 reworked comment of IPTable struct
Signed-off-by: Benjamin Böhmke <benjamin@boehmke.net>
2020-07-22 15:08:22 +02:00
Benjamin Böhmke
1e1408f421 additional EnableIPTables check in isolateNetwork
Signed-off-by: Benjamin Böhmke <benjamin@boehmke.net>
2020-07-22 15:06:19 +02:00
Benjamin Böhmke
a4fcced708 enabled ipv6 parameter in TestSetupIPForwarding
Signed-off-by: Benjamin Böhmke <benjamin@boehmke.net>
2020-07-22 15:05:51 +02:00
Benjamin Böhmke
4d1c92c155 resorted EnableIP6Tables in driver configure
Signed-off-by: Benjamin Böhmke <benjamin@boehmke.net>
2020-07-21 18:50:03 +02:00
Benjamin Böhmke
9bc2f88f04 isolateNetwork for both IP version
Signed-off-by: Benjamin Böhmke <benjamin@boehmke.net>
2020-07-21 18:14:19 +02:00
Benjamin Böhmke
ccad03a139 split setupIPTables into setupIP4Tables and setupIP6Tables
Signed-off-by: Benjamin Böhmke <benjamin@boehmke.net>
2020-07-21 18:14:07 +02:00
Benjamin Böhmke
9cf5335269 default DROP policy on firewall reload also for IPv6
Signed-off-by: Benjamin Böhmke <benjamin@boehmke.net>
2020-07-21 15:24:20 +02:00
Benjamin Böhmke
ec7df93731 replace string.Contains* with net.IP.To4() check
Signed-off-by: Benjamin Böhmke <benjamin@boehmke.net>
2020-07-21 15:23:33 +02:00
Benjamin Böhmke
3475f006b7 moved some ipv6 config to setupIPForwarding
Signed-off-by: Benjamin Böhmke <benjamin@boehmke.net>
2020-07-19 16:17:02 +02:00
Benjamin Böhmke
dfd1925ed1 Renamed driver config variable to EnableIP6Tables
Signed-off-by: Benjamin Böhmke <benjamin@boehmke.net>
2020-07-19 16:17:02 +02:00
Billy Ridgway
8dbb5b5a7d Implement NAT IPv6 to fix the issue https://github.com/moby/moby/issues/25407
Signed-off-by: Billy Ridgway <wrridgwa@us.ibm.com>
Signed-off-by: Benjamin Böhmke <benjamin@boehmke.net>
2020-07-19 16:16:51 +02:00
Sebastiaan van Stijn
570c5f9e76 testing: remove use of docker/docker/errdefs in tests
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-06-17 11:08:39 +02:00
Sebastiaan van Stijn
27345e8f8f log error instead if disabling IPv6 router advertisement failed
Previously, failing to disable IPv6 router advertisement prevented the daemon to
start.

An issue was reported by a user that started docker using `systemd-nspawn "machine"`,
which produced an error;

    failed to start daemon: Error initializing network controller:
    Error creating default "bridge" network: libnetwork:
    Unable to disable IPv6 router advertisement:
    open /proc/sys/net/ipv6/conf/docker0/accept_ra: read-only file system

This patch changes the error to a log-message instead.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-06-12 19:32:18 +02:00
Sebastiaan van Stijn
9fd12a5e31 client/mflag: remove use of docker/docker/pkg/homedir
The homedir package was only used to print default values for
flags that contained paths inside the user's home-directory in
a slightly nicer way (replace `/users/home` with `~`).

Given that this is not critical, we can replace this with golang's
function, which does not depend on libcontainer.

There's still one use of the homedir package in docker/docker/opts,
which is used by the dnet binary (but only requires the homedir
package when running in rootless mode)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-06-04 12:48:37 +02:00
Sebastiaan van Stijn
42b87e6a4b types: remove some dead code
These errors were not in use, so we can remove them

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-06-04 12:07:03 +02:00
Tibor Vass
dc89fc3449 Merge pull request #2558 from thaJeztah/master_router_advertisements
[master] bridge: disable IPv6 router advertisements
2020-06-02 11:02:38 -07:00
Samuel Karp
e65003a722 bridge: disable IPv6 router advertisements
Signed-off-by: Samuel Karp <skarp@amazon.com>
(cherry picked from commit 9489546c44d94d37337191c263879a7ac075a331)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-06-02 12:06:39 +02:00
Xinfeng Liu
0c8ffda2ab Fix 'failed to get network during CreateEndpoint'
Fix 'failed to get network during CreateEndpoint' during container starting.
Change the error type to `libnetwork.ErrNoSuchNetwork`, so `Start()` in `daemon/cluster/executor/container/controller.go` will recreate the network.

Signed-off-by: Xinfeng Liu <xinfeng.liu@gmail.com>
2020-06-01 17:16:07 +08:00
Arko Dasgupta
fd1765ca9b Merge pull request #2556 from thaJeztah/remove_unused_error
store.getNetworksFromStore() remove unused error return
2020-05-28 20:03:21 -07:00
Sebastiaan van Stijn
07ed00102d store.getNetworksFromStore() remove unused error return
This function always returned `nil`, so we can remove the error
return, and update other functions that were handling errors.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-05-26 10:39:38 +02:00
Arko Dasgupta
3f0652ac36 Merge pull request #2548 from arkodg/add-intf-firewalld-zone
Add docker interfaces to firewalld docker zone
2020-05-21 11:34:49 -07:00
Sebastiaan van Stijn
efe0ab37a1 Resolver: fix error handling if we didn't receive a response
Commit 2a480d515e updated the DNS library
and updated the error handling.

Due to changes in the library, we now had to check the response itself
to check if the response was truncated (Truncated DNS replies should
be sent to the client so that the client can retry over TCP).

However, 1e02aae252 added an incorrect
`nil` check to fix a panic, which ignored situations where
an error was returned, but no response (for example, if we failed
to connect to the DNS server).

In that situation, the error would be ignored, and further down we
would consider the connection to have been succesfull, but the DNS
server not returning a result.

After a "successful" lookup (but no results), we break the loop,
and don't attempt lookups in other DNS servers.

Versions before 1e02aae252 would produce:

    Name To resolve: bbc.co.uk.
    [resolver] query bbc.co.uk. (A) from 172.21.0.2:36181, forwarding to udp:192.168.5.1
    [resolver] read from DNS server failed, read udp 172.21.0.2:36181->192.168.5.1:53: i/o timeout
    [resolver] query bbc.co.uk. (A) from 172.21.0.2:38582, forwarding to udp:8.8.8.8
    [resolver] received A record "151.101.0.81" for "bbc.co.uk." from udp:8.8.8.8
    [resolver] received A record "151.101.192.81" for "bbc.co.uk." from udp:8.8.8.8
    [resolver] received A record "151.101.64.81" for "bbc.co.uk." from udp:8.8.8.8
    [resolver] received A record "151.101.128.81" for "bbc.co.uk." from udp:8.8.8.8

Versions after that commit would ignore the error, and stop further lookups:

    Name To resolve: bbc.co.uk.
    [resolver] query bbc.co.uk. (A) from 172.21.0.2:59870, forwarding to udp:192.168.5.1
    [resolver] external DNS udp:192.168.5.1 returned empty response for "bbc.co.uk."

This patch updates the logic to handle the error to log the error (and continue with the next DNS):

 - if an error is returned, and no response was received
 - if an error is returned, but it was not related to a truncated response

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Tibor Vass <tibor@docker.com>
2020-05-21 17:50:39 +00:00
fanjiyun
a24e5f5fd4 reduce parameters for func JoinOptionPriority
Signed-off-by: fanjiyun <fan.jiyun@zte.com.cn>
2020-05-15 18:29:54 +08:00
Arko Dasgupta
23d1ca4426 Add docker interfaces to firewalld docker zone
If firewalld is running, create a new docker zone and
add the docker interfaces to the docker zone to allow
container networking for distros with firewalld enabled

Fixes: https://github.com/moby/libnetwork/issues/2496

Signed-off-by: Arko Dasgupta <arko.dasgupta@docker.com>
2020-05-07 18:37:33 -07:00
Sebastiaan van Stijn
c30d55d067 vendor: update moby/ipvs v1.0.1
full diff: https://github.com/moby/ipvs/compare/v1.0.0...v1.0.1

- Fix compatibility issue on older kernels (< 3.18) where the address
  family attribute for destination servers do not exist
- Fix the stats attribute check when parsing destination addresses
- NetlinkSocketsTimeout should be a constant

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-04-28 17:04:14 +02:00
Arko Dasgupta
7fd076595a Merge pull request #2471 from suwang48404/master
DOCKER-USER chain not created when IPTableEnable=false.
2020-04-09 15:01:08 -07:00
Arko Dasgupta
c7f0b0152e Fix NPE due to null value returned by ep.Iface()
This PR carryforwards https://github.com/moby/libnetwork/pull/2239
and incorporates the suggestions in comments to fix the NPE and
potential NPEs due to a null value returned by ep.Iface()

Signed-off-by: Arko Dasgupta <arko.dasgupta@docker.com>
2020-04-02 22:34:55 -07:00
Sebastiaan van Stijn
6b3673877c Merge pull request #2538 from wangyumu/add-error-invalid-default-address-pools
Fixes moby/moby#40388, produce an error with invalid address pool
2020-03-31 19:45:25 +02:00
Arko Dasgupta
2e64325fee Merge pull request #2540 from SamWhited/resolver_panic
Fixes a panic in the DNS resolver
2020-03-18 11:26:00 -07:00
Arko Dasgupta
e49ee8266d Merge pull request #2460 from moby/revert-2450-iptables-policy
Revert "Always configure iptables forward policy"
2020-03-18 11:22:47 -07:00
Sam Whited
1e02aae252 Fixes a panic in the DNS resolver
Under certain conditions it appears that the DNS response and returned
error can be nil. When this happens, checking resp.Truncated results in
a nil panic so we must first check that the response is not nil before
checking if a truncated response was received.

See moby/moby#40715

Signed-off-by: Sam Whited <sam@samwhited.com>
2020-03-18 13:59:59 -04:00
Wang Yumu
4dda50d226 Fixes moby/moby#40388
Signed-off-by: Wang Yumu <37442693@qq.com>
2020-03-18 00:09:10 +08:00
Sebastiaan van Stijn
d846c2b1ab vendor: update vishvananda/netlink v1.1.0
full diff: https://github.com/vishvananda/netlink/compare/v1.0.0...v1.1.0

also updated moby/ipvs, which is compatible with this version of netlink,
and update vishvananda/netns to current master (which added go.mod)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-03-12 18:25:54 +01:00
Brian Goff
a533fe7094 Use vendored ipvs package
The ipvs package was moved to a separate repo.

The ipvs package is a fairly generic set of helpers for managing IPVS.
The ipvs package is used by docker swarm and kubernetes.
Because we want to merge libnetwork back into the moby/moby codebase
while also not creating more dependencies for other projects on
moby/moby itself, it was decided that the best path for ipvs is to live
on it's own since there are no other ties to libnetwork.

Ref: https://github.com/moby/libnetwork/issues/2522

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2020-03-11 12:13:37 -07:00
elangovan sivanandam
c485bbf754 Merge pull request #2523 from arkodg/seperate-internal-empty-parent
Macvlan: Separate empty parent and internal
2020-03-05 15:26:57 -05:00
elangovan sivanandam
a9596db128 Merge pull request #2524 from trapier/cleanup-vfp-during-network-removal
Cleanup VFP during overlay network removal
2020-03-05 14:55:50 -05:00
Arko Dasgupta
76b5905cbe Macvlan: Separate empty parent and internal
https://github.com/docker/libnetwork/pull/2419 and
https://github.com/docker/libnetwork/pull/2407
attempted to seperate out empty parent and internal for
macvlan and ipvlan networks

However it didnt pass the integration tests in moby
https://github.com/moby/moby/pull/40596 and exposed some
more plumbing that needed to be done to make sure
we separate the two things

If the -o parent is empty we create a dummylink
and if internal is set we dont add a default gateway
and make sure north-south communication cannot take place
(only east-west / container-container can)

Signed-off-by: Arko Dasgupta <arko.dasgupta@docker.com>
2020-03-04 13:24:10 -08:00
Arko Dasgupta
402a6b7dbc Merge pull request #2519 from wangyumu/fix-InhibitIPv4-nil-panic
Fix InhibitIPv4 nil panic
2020-03-04 13:20:06 -08:00
Trapier Marshall
c39ac9c05e Cleanup VFP during overlay network removal
Deleting a network sandbox on Linux implicitly clears OS (ipvs) load
balancer state.  Deleting an HNS network on Windows by contrast does not
inherently remove its corresponding VFP load balancers. The method to
remove load balancers belongs to the network and so must be called prior
to or while deleting a network. This commit reverts one line from
ea2fa20859, reintroducing a call to
explicitly remove backend load balancers during network removal.

Signed-off-by: Trapier Marshall <tmarshall@mirantis.com>
2020-03-03 19:48:38 -05:00
Wang Yumu
41a91e9a5d fix InhibitIPv4 nil panic
Signed-off-by: Wang Yumu <37442693@qq.com>
2020-03-02 23:38:13 +08:00
Akihiro Suda
7ca71f2c49 vendor godbus/dbus v5
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-02-28 18:47:00 +09:00
Sebastiaan van Stijn
add7253d68 Dockerfile: update to Go 1.13.8
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-02-27 11:46:18 +01:00
Sebastiaan van Stijn
129e28baa3 Fix gofmt in preparation of Go 1.13 update
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-02-27 11:46:16 +01:00
elangovan sivanandam
c3cf1da916 Merge pull request #2513 from thaJeztah/bump_golang_1.12.17
Dockerfile: update to Golang 1.12.17
2020-02-26 18:06:17 -05:00
elangovan sivanandam
ff09e6c12a Merge pull request #2512 from thaJeztah/debian_buster
Dockerfile: switch to debian "buster", and regenerate protobuf
2020-02-26 15:53:58 -05:00
Arko Dasgupta
68f261bfff Merge pull request #2407 from lemrouch/2406-fix
Macvlan internal network should not change default gateway
2020-02-26 09:28:30 -08:00
Sebastiaan van Stijn
847f469e76 regenerate protobufs with debian buster
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-02-26 16:03:42 +01:00
Sebastiaan van Stijn
6dc0d4ff60 Dockerfile: update to Golang 1.12.17
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-02-26 15:42:50 +01:00
Sebastiaan van Stijn
c18a3a075e Dockerfile: switch to debian "buster"
Debian Buster is now the current "stable", and will be the default
baseimage for Golang images going forward.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-02-26 15:40:11 +01:00
Sam Whited
2a480d515e Bump the DNS library and revendor
Signed-off-by: Sam Whited <sam@samwhited.com>
2020-02-25 15:37:30 -05:00
Sam Whited
9cd3fb6796 Re-vendor with newer vndr
Signed-off-by: Sam Whited <sam@samwhited.com>
2020-02-25 15:37:23 -05:00
Arko Dasgupta
812104ceae Merge pull request #2500 from tklauser/cli-pkg-migrate
Migrate from github.com/codegangsta/cli to github.com/urfave/cli
2020-02-21 15:22:28 -08:00
Pavel Matěja
c7f8bfa001 Fix internal ipvlan network to work in swarm
Using dummy interface allows communication beween containers only if
they are running on the same node in swarm.

Signed-off-by: Pavel Matěja <pavel@verotel.cz>
2020-02-20 19:33:48 +00:00
Pavel Matěja
b0bce9159e Fix internal macvlan network to work in swarm
Using dummy interface allows communication beween containers only if
they are running on the same node in swam.

Signed-off-by: Pavel Matěja <pavel@verotel.cz>
2020-02-20 19:33:48 +00:00
Pavel Matěja
76bccc5ad4 Ipvlan internal network should not change gw
Since docker container can be connected to combination of several
internal and external networks change of default gateway of the internal
ones breaks communication via the external ones.

This fixes only ipvlan network type

Signed-off-by: Pavel Matěja <pavel@verotel.cz>
2020-02-20 17:49:42 +00:00
Arko Dasgupta
14fbe41991 Update design.md
The roadmap document was outdated, and removed in #2316, so remove the link from here

Signed-off-by: Arko Dasgupta <arko.dasgupta@docker.com>
2020-02-18 17:21:39 -08:00
Arko Dasgupta
a6d52f1521 Merge pull request #2491 from ahjumma/master
Improving load balancer performance
2020-02-16 19:31:14 -08:00
Arko Dasgupta
7bb9876f89 Merge pull request #2498 from wawa0210/bump-hcsshim-v0.8.7
Update vendored dependency hcsshim to v0.8.7
2020-02-16 14:30:42 -08:00
Arko Dasgupta
b8b9d67d1a Merge pull request #2454 from arkodg/add-host-ip-snat
Support for com.docker.network.host_ipv4 driver label
2020-02-15 08:32:56 -08:00
Arko Dasgupta
b5b12d8bec Merge pull request #2317 from gsomlo/gls-bridge-inhibit-ipv4
Allow bridge net driver to skip IPv4 configuration of bridge interface
2020-02-14 14:47:24 -08:00
akim01
9ced389e6e Improving load balancer performance
Further improving load balancer performance by expiring
connections to servers with weights set to 0.

Signed-off-by: Andrew Kim <taeyeonkim90@gmail.com>
2020-02-14 13:24:06 -08:00
Madhu Venugopal
cb48244350 Merge pull request #2494 from thaJeztah/add_arko_to_maintainers
Add Arko to maintainers
2020-02-06 05:29:59 -08:00
Tobias Klauser
5cc6ffae0c Migrate from github.com/codegangsta/cli to github.com/urfave/cli
The library was moved quite a while ago, adjust the module path. No code
changes.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2020-01-24 11:12:07 +01:00
wawa0210
cc7847ddd2 Update vendored dependency hcsshim to v0.8.7
Signed-off-by: wawa0210 <xiaozhang0210@hotmail.com>
2020-01-11 08:08:53 +00:00
elangovan sivanandam
e2c0d868ab Merge pull request #2380 from liskin/bridge-atomic-hwaddr
bridge: Fix hwaddr set race between us and udev
2019-12-31 19:30:42 -05:00
Sebastiaan van Stijn
6492936018 Add Arko to maintainers
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-12-31 11:04:32 +01:00