Commit 6d1c268
committed
Release IPv6 address if unused due to sysctl setting
When running:
docker network create --ipv6 b46
docker run --rm -ti \
--network name=b46,driver-opt=com.docker.network.endpoint.sysctls=net.ipv6.conf.IFNAME.disable_ipv6=1 \
busybox
IPv6 is enabled in the container and the network, so an IPv6 address
will be allocated for the endpoint.
But, when the sysctl is applied, the IPv6 address will be removed
from the interface ... so, no unsolicited neighbour advertisement
should be (or can be) sent and, the endpoint should not be treated
as dual-stack when selecting a gateway endpoint and, if it is
selected as the gateway endpoint, setting up an IPv6 route via the
network will fail.
So, if the IPv6 address disappears after sysctls have been applied,
release the address and remove it from the endpoint's config.
TODO ...
- hosts entries
- legacy links have old address (which may get recycled, so possibly
harmful to have it left around in iptables and hosts).
- maybe bail out of Endpoint.sbJoin if osSbox==nil before setting
up addresses for hosts, DNS etc - and only do that stuff during
SetKey, after successfully configuring the interface with an IPv6
address?
Signed-off-by: Rob Murray <rob.murray@docker.com>1 parent 1021211 commit 6d1c268Copy full SHA for 6d1c268
11 files changed
+228-18Lines changed: 228 additions & 18 deletions
File tree
Expand file treeCollapse file tree
Open diff view settings
Filter options
- daemon
- integration/networking
- libnetwork
- drivers/bridge
- netlabel
- osl
Expand file treeCollapse file tree
Open diff view settings
Collapse file
daemon/container_operations.go
Copy file name to clipboardExpand all lines: daemon/container_operations.go+18-4Lines changed: 18 additions & 4 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
736 | 736 | |
737 | 737 | |
738 | 738 | |
739 | | - |
740 | | - |
741 | | - |
742 | | - |
743 | 739 | |
| 740 | + |
| 741 | + |
| 742 | + |
| 743 | + |
| 744 | + |
| 745 | + |
| 746 | + |
| 747 | + |
| 748 | + |
| 749 | + |
| 750 | + |
744 | 751 | |
745 | 752 | |
746 | 753 | |
| ||
751 | 758 | |
752 | 759 | |
753 | 760 | |
| 761 | + |
| 762 | + |
| 763 | + |
754 | 764 | |
755 | 765 | |
756 | 766 | |
757 | 767 | |
| 768 | + |
| 769 | + |
| 770 | + |
| 771 | + |
758 | 772 | |
759 | 773 | |
760 | 774 | |
|
Collapse file
+4Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
1102 | 1102 | |
1103 | 1103 | |
1104 | 1104 | |
| 1105 | + |
| 1106 | + |
| 1107 | + |
| 1108 | + |
1105 | 1109 | |
1106 | 1110 | |
1107 | 1111 | |
|
Collapse file
integration/networking/bridge_linux_test.go
Copy file name to clipboardExpand all lines: integration/networking/bridge_linux_test.go+81-4Lines changed: 81 additions & 4 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
31 | 31 | |
32 | 32 | |
33 | 33 | |
| 34 | + |
34 | 35 | |
35 | 36 | |
36 | 37 | |
| ||
777 | 778 | |
778 | 779 | |
779 | 780 | |
| 781 | + |
| 782 | + |
| 783 | + |
| 784 | + |
| 785 | + |
| 786 | + |
| 787 | + |
| 788 | + |
| 789 | + |
| 790 | + |
| 791 | + |
| 792 | + |
| 793 | + |
| 794 | + |
| 795 | + |
| 796 | + |
| 797 | + |
| 798 | + |
| 799 | + |
| 800 | + |
| 801 | + |
| 802 | + |
| 803 | + |
| 804 | + |
| 805 | + |
| 806 | + |
| 807 | + |
| 808 | + |
| 809 | + |
| 810 | + |
| 811 | + |
| 812 | + |
| 813 | + |
| 814 | + |
| 815 | + |
| 816 | + |
| 817 | + |
| 818 | + |
| 819 | + |
| 820 | + |
| 821 | + |
| 822 | + |
| 823 | + |
| 824 | + |
| 825 | + |
| 826 | + |
| 827 | + |
| 828 | + |
| 829 | + |
| 830 | + |
| 831 | + |
| 832 | + |
| 833 | + |
| 834 | + |
| 835 | + |
| 836 | + |
| 837 | + |
| 838 | + |
| 839 | + |
| 840 | + |
| 841 | + |
| 842 | + |
| 843 | + |
| 844 | + |
| 845 | + |
| 846 | + |
| 847 | + |
| 848 | + |
| 849 | + |
| 850 | + |
| 851 | + |
| 852 | + |
| 853 | + |
780 | 854 | |
781 | 855 | |
782 | 856 | |
| ||
1234 | 1308 | |
1235 | 1309 | |
1236 | 1310 | |
1237 | | - |
1238 | | - |
1239 | | - |
| 1311 | + |
| 1312 | + |
| 1313 | + |
| 1314 | + |
| 1315 | + |
| 1316 | + |
1240 | 1317 | |
1241 | 1318 | |
1242 | 1319 | |
| ||
1254 | 1331 | |
1255 | 1332 | |
1256 | 1333 | |
1257 | | - |
| 1334 | + |
1258 | 1335 | |
1259 | 1336 | |
1260 | 1337 | |
|
Collapse file
libnetwork/drivers/bridge/bridge_linux.go
Copy file name to clipboardExpand all lines: libnetwork/drivers/bridge/bridge_linux.go+13Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
111 | 111 | |
112 | 112 | |
113 | 113 | |
| 114 | + |
114 | 115 | |
115 | 116 | |
116 | 117 | |
| ||
1452 | 1453 | |
1453 | 1454 | |
1454 | 1455 | |
| 1456 | + |
| 1457 | + |
| 1458 | + |
| 1459 | + |
1455 | 1460 | |
1456 | 1461 | |
1457 | 1462 | |
| ||
1670 | 1675 | |
1671 | 1676 | |
1672 | 1677 | |
| 1678 | + |
| 1679 | + |
| 1680 | + |
| 1681 | + |
| 1682 | + |
| 1683 | + |
| 1684 | + |
| 1685 | + |
1673 | 1686 | |
1674 | 1687 | |
Collapse file
+63-5Lines changed: 63 additions & 5 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
559 | 559 | |
560 | 560 | |
561 | 561 | |
| 562 | + |
| 563 | + |
| 564 | + |
562 | 565 | |
563 | 566 | |
564 | 567 | |
565 | 568 | |
566 | 569 | |
567 | | - |
568 | | - |
569 | | - |
570 | 570 | |
571 | 571 | |
572 | 572 | |
| ||
699 | 699 | |
700 | 700 | |
701 | 701 | |
| 702 | + |
| 703 | + |
| 704 | + |
702 | 705 | |
703 | 706 | |
704 | 707 | |
| ||
1045 | 1048 | |
1046 | 1049 | |
1047 | 1050 | |
1048 | | - |
| 1051 | + |
1049 | 1052 | |
1050 | 1053 | |
1051 | 1054 | |
| ||
1334 | 1337 | |
1335 | 1338 | |
1336 | 1339 | |
1337 | | - |
| 1340 | + |
1338 | 1341 | |
1339 | 1342 | |
1340 | 1343 | |
| ||
1361 | 1364 | |
1362 | 1365 | |
1363 | 1366 | |
| 1367 | + |
| 1368 | + |
| 1369 | + |
| 1370 | + |
| 1371 | + |
| 1372 | + |
| 1373 | + |
| 1374 | + |
| 1375 | + |
| 1376 | + |
| 1377 | + |
| 1378 | + |
| 1379 | + |
| 1380 | + |
| 1381 | + |
| 1382 | + |
| 1383 | + |
| 1384 | + |
| 1385 | + |
| 1386 | + |
| 1387 | + |
| 1388 | + |
| 1389 | + |
| 1390 | + |
| 1391 | + |
| 1392 | + |
| 1393 | + |
| 1394 | + |
| 1395 | + |
| 1396 | + |
| 1397 | + |
| 1398 | + |
| 1399 | + |
| 1400 | + |
| 1401 | + |
| 1402 | + |
| 1403 | + |
| 1404 | + |
| 1405 | + |
| 1406 | + |
| 1407 | + |
| 1408 | + |
| 1409 | + |
| 1410 | + |
| 1411 | + |
| 1412 | + |
| 1413 | + |
| 1414 | + |
| 1415 | + |
| 1416 | + |
| 1417 | + |
| 1418 | + |
| 1419 | + |
| 1420 | + |
| 1421 | + |
1364 | 1422 | |
1365 | 1423 | |
1366 | 1424 | |
|
Collapse file
libnetwork/netlabel/labels.go
Copy file name to clipboardExpand all lines: libnetwork/netlabel/labels.go+7Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
70 | 70 | |
71 | 71 | |
72 | 72 | |
| 73 | + |
| 74 | + |
| 75 | + |
| 76 | + |
| 77 | + |
| 78 | + |
| 79 | + |
73 | 80 | |
Collapse file
+1-1Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
1233 | 1233 | |
1234 | 1234 | |
1235 | 1235 | |
1236 | | - |
| 1236 | + |
1237 | 1237 | |
1238 | 1238 | |
1239 | 1239 | |
|
Collapse file
libnetwork/osl/interface_linux.go
Copy file name to clipboardExpand all lines: libnetwork/osl/interface_linux.go+19Lines changed: 19 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
225 | 225 | |
226 | 226 | |
227 | 227 | |
| 228 | + |
| 229 | + |
228 | 230 | |
229 | 231 | |
230 | 232 | |
| ||
641 | 643 | |
642 | 644 | |
643 | 645 | |
| 646 | + |
| 647 | + |
| 648 | + |
| 649 | + |
| 650 | + |
| 651 | + |
| 652 | + |
| 653 | + |
| 654 | + |
| 655 | + |
| 656 | + |
| 657 | + |
| 658 | + |
| 659 | + |
| 660 | + |
| 661 | + |
| 662 | + |
644 | 663 | |
645 | 664 | |
646 | 665 | |
|
Collapse file
libnetwork/osl/namespace_linux.go
Copy file name to clipboardExpand all lines: libnetwork/osl/namespace_linux.go+2-2Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
251 | 251 | |
252 | 252 | |
253 | 253 | |
254 | | - |
| 254 | + |
| 255 | + |
255 | 256 | |
256 | 257 | |
257 | 258 | |
| ||
518 | 519 | |
519 | 520 | |
520 | 521 | |
521 | | - |
522 | 522 | |
523 | 523 | |
524 | 524 | |
|
Collapse file
libnetwork/osl/route_linux.go
Copy file name to clipboardExpand all lines: libnetwork/osl/route_linux.go+2-2Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
241 | 241 | |
242 | 242 | |
243 | 243 | |
244 | | - |
| 244 | + |
245 | 245 | |
246 | 246 | |
247 | 247 | |
| ||
309 | 309 | |
310 | 310 | |
311 | 311 | |
312 | | - |
| 312 | + |
313 | 313 | |
314 | 314 | |
315 | 315 | |
|
0 commit comments