Yong Tang
72db6e475a
Fix issue for --fixed-cidr when bridge has multiple addresses
...
This fix tries to address the issue raised in 26341
where multiple addresses in a bridge may cause `--fixed-cidr`
to not have the correct addresses.
The issue is that `netutils.ElectInterfaceAddresses(bridgeName)`
only returns the first IPv4 address.
This fix (together with the PR created in libnetwork )
changes `ElectInterfaceAddresses()` and `addresses()`
so that all IPv4 addresses are returned. This will allow the
possibility of selectively choose the address needed.
In `daemon_unix.go`, bridge address is chosen by comparing with
the `--fixed-cidr` first, thus resolve the issue in 26341.
This fix is tested manually, as is described in 26341:
```
brctl addbr cbr0
ip addr add 10.111.111.111/20 dev cbr0 label cbr0:main
ip addr add 10.222.222.222/12 dev cbr0 label cbr0:docker
ip link set cbr0 up
docker daemon --bridge=cbr0 --iptables=false --ip-masq=false --fixed-cidr=10.222.222.222/24
docker run --rm busybox ip route get 8.8.8.8 | grep -Po 'src.*'
src 10.222.222.0
```
This fix fixes 26341.
Signed-off-by: Yong Tang <yong.tang.github@outlook.com >
Upstream-commit: e9c4c513d11e6c3986f8858b9a11535d61cfdf74
Component: engine
2016-10-26 20:11:29 -07:00
..
2016-10-25 14:17:57 -07:00
2016-09-12 07:36:52 +00:00
2016-10-24 00:20:36 -07:00
2016-10-24 15:20:01 -07:00
2016-10-18 01:33:28 -07:00
2016-09-13 14:21:58 -07:00
2016-05-06 16:08:53 -07:00
2016-09-07 11:05:58 -07:00
2016-09-16 12:27:13 -04:00
2016-09-07 11:05:58 -07:00
2016-09-23 11:30:06 -07:00
2016-05-24 21:31:15 +02:00
2016-09-23 19:37:43 +08:00
2016-10-25 06:43:54 +00:00
2016-10-20 19:31:24 -07:00
2016-10-24 15:20:01 -07:00
2016-08-25 13:09:03 -04:00
2016-10-17 18:48:40 +08:00
2016-10-17 18:48:40 +08:00
2016-10-26 11:33:06 -04:00
2016-10-17 18:48:40 +08:00
2016-10-17 11:48:51 -07:00
2016-10-24 18:12:28 -07:00
2016-09-21 13:29:17 -07:00
2016-10-17 16:50:39 +02:00
2016-10-13 14:51:10 -07:00
2016-10-22 08:53:57 +08:00
2016-09-16 12:27:13 -04:00
2016-09-13 09:55:35 -04:00
2016-09-13 09:55:35 -04:00
2016-10-22 08:53:57 +08:00
2016-10-24 15:20:01 -07:00
2016-10-10 11:37:36 -07:00
2016-10-20 07:54:31 +08:00
2016-10-03 10:40:05 -07:00
2016-10-26 20:11:29 -07:00
2016-05-23 16:37:12 -07:00
2016-10-25 10:30:00 -07:00
2016-10-25 09:02:28 -07:00
2016-07-21 20:04:47 -07:00
2016-07-21 20:04:47 -07:00
2016-10-14 09:15:17 -07:00
2016-09-27 18:06:54 +08:00
2016-09-27 18:06:54 +08:00
2016-09-01 01:07:05 +08:00
2016-09-01 01:07:05 +08:00
2016-10-20 13:24:23 -07:00
2016-09-16 12:27:13 -04:00
2016-09-07 11:05:58 -07:00
2016-09-07 11:05:58 -07:00
2016-09-27 12:07:35 -07:00
2016-05-23 16:37:12 -07:00
2016-10-24 00:20:36 -07:00
2016-10-20 19:31:24 -07:00
2016-09-07 11:05:58 -07:00
2016-10-14 15:49:12 +01:00
2016-09-18 09:40:16 -04:00
2016-05-21 22:36:11 +02:00
2016-09-15 18:08:19 -07:00
2016-10-06 11:46:24 -07:00
2016-09-07 11:05:58 -07:00
2016-09-07 11:05:58 -07:00
2016-09-15 18:08:19 -07:00
2016-10-06 17:12:17 -07:00
2016-10-20 13:24:23 -07:00
2016-09-07 11:05:58 -07:00
2016-10-24 15:20:01 -07:00
2016-09-07 11:05:58 -07:00
2016-09-13 09:55:35 -04:00
2016-09-13 09:55:35 -04:00
2016-10-20 17:06:11 +02:00
2016-06-27 10:23:37 -07:00
2016-06-27 10:23:37 -07:00
2016-09-19 12:59:02 -07:00
2016-09-07 11:05:58 -07:00
2016-05-23 16:37:12 -07:00
2016-10-20 13:24:23 -07:00
2016-10-06 22:48:53 -03:00
2016-10-06 22:48:53 -03:00
2016-09-07 11:05:58 -07:00
2016-10-24 00:20:36 -07:00
2016-04-06 14:03:05 -07:00
2016-05-23 16:37:12 -07:00
2016-10-24 00:20:36 -07:00
2016-10-24 00:20:36 -07:00
2016-09-13 09:55:35 -04:00
2016-08-22 13:41:17 -07:00
2016-10-24 15:21:14 -07:00
2016-10-26 11:33:06 -04:00
2016-09-27 12:07:35 -07:00
2016-10-19 15:50:37 +02:00
2016-10-25 06:43:54 +00:00
2016-06-27 19:58:05 -07:00
2016-10-17 12:53:35 -07:00
2016-09-07 11:05:58 -07:00
2016-09-07 11:05:58 -07:00
2016-08-17 09:38:34 -07:00
2016-09-01 11:53:07 +02:00
2016-07-08 17:26:42 -07:00
2016-10-07 12:09:54 -07:00
2016-10-07 12:09:54 -07:00
2016-10-24 00:20:36 -07:00
2016-05-23 16:37:12 -07:00
2016-09-16 11:56:15 -07:00
2016-09-16 11:56:15 -07:00
2016-09-16 11:56:15 -07:00
2016-09-21 12:36:52 +02:00
2016-09-16 11:56:15 -07:00
2016-09-16 11:56:15 -07:00
2016-10-17 12:53:35 -07:00
2016-07-08 05:58:11 +00:00
2016-09-07 11:05:58 -07:00
2016-09-07 16:29:02 -07:00
2016-08-29 10:16:18 +08:00
2016-09-07 11:05:58 -07:00
2016-09-07 11:05:58 -07:00
2016-09-07 11:05:58 -07:00
2016-09-07 11:05:58 -07:00
2016-09-13 09:55:35 -04:00
2016-09-27 12:07:35 -07:00
2016-10-20 05:14:27 -07:00
2016-06-14 16:49:04 -07:00