Commit graph

676 commits

Author SHA1 Message Date
Flavio Crisciani
ad577a25fe Changed ipMask to string
Avoid error logs in case of local peer case, there is no need for deleteNeighbor
Avoid the network leave to readvertise already deleted entries to upper layer

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-10-02 17:29:18 -07:00
Flavio Crisciani
181115b350 Addressing code review comments
Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-10-02 11:12:36 -07:00
Flavio Crisciani
2bad0fbedf log for miss notification
Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-10-02 11:12:36 -07:00
Flavio Crisciani
3e7b6c9cb0 flush peerdb entries on network delete
peerDB was never being flushed on network delete
leaveing behind stale entries

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-10-02 11:12:35 -07:00
Flavio Crisciani
711d033757 Handle IP reuse in overlay
In case of IP reuse locally there was a race condition
that was leaving the overlay namespace with wrong configuration
causing connectivity issues.
This commit introduces the use of setMatrix to handle the transient
state and make sure that the proper configuration is maintained

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-10-02 11:12:33 -07:00
Sandeep Bansal
8b400916ce Ignore failure to save hns endpoint to store
Signed-off-by: Sandeep Bansal <sabansal@microsoft.com>
2017-09-21 23:24:55 -07:00
Flavio Crisciani
729d45379f Fix lint issues
The package updated and now shows new warnings that had to be corrected
to let the CI pass

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-09-20 08:57:02 -07:00
Flavio Crisciani
7d466c6600 Fix concurrent CreateNetwork in bridge driver
The CreateNetwork in the bridge driver was not able to properly
handle concurrent operations causing 2 issues:
1) crash from nil pointer exception
2) not proper handling of conflicting configuration

This commit addresses the 2 previous mentioned issues
and adds a test for it.
The test with the original code has a low failure frequency
to confirm the fix I had to add a time.Sleep in the body of the
CreateNetwork so to have a 100% failure

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-09-08 15:18:33 -07:00
Flavio Crisciani
a0bdc52fd7 Merge pull request #1900 from pradipd/overlay_one_endpoint
Tasks connected to a swarm network will have 1 endpoint on windows RS3.
2017-08-28 09:22:28 -07:00
Flavio Crisciani
38382fb29b Merge pull request #1752 from aaronlehmann/sprintfs
all: Avoid trivial uses of Sprintf
2017-08-23 15:49:46 -07:00
Brian Goff
663672b8c7 Lock goroutine to OS thread while changing NS
Prevents an issue where the goroutine may jump to a new OS thread during
execution putting it into a mount/network NS that is unexpected.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit 6d8617d8757a759d806a3307ca04d4d588c04aed)
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2017-08-16 12:14:56 -04:00
Flavio Crisciani
a15113e012 Remove useless flags on operations
In the peerDelete the updateDB flag was always true
In the peerAdd the updateDB flag was always true except for
the initSandbox case. But now the initSandbox is handled by the
go routing of the peer operations, so we can move that flag
down and remove it from the top level functions

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-08-14 09:20:55 -07:00
Madhu Venugopal
5de16c2168 Merge pull request #1902 from fcrisciani/fix-peerdelete
PeerDbDelete was passing the wrong field
2017-08-11 16:47:58 -07:00
Flavio Crisciani
b7c258cf07 PeerDbDelete was passing the wrong field
The peerDbDelete was passing the wrong field to the underlay
Delete operation causing the mac entry to not being deleted
from the bridge on the overlay. This caused connectivity issue
when a container that before was remote was now scheduled
on the local node. The entry was such:
bridge fdb show | grep -i 02:42:0a:01:00:02
02:42:0a:01:00:02 dev vxlan0 master br0
02:42:0a:01:00:02 dev vxlan0 dst 172.31.14.63 link-netnsid 0 self permanent
That was still pointing to a remove node

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-08-11 16:19:59 -07:00
Pradip Dhara
0651183f84 gofmt and lint changes.
Signed-off-by: Pradip Dhara <pradipd@microsoft.com>
2017-08-09 15:53:27 -07:00
Pradip Dhara
404a9ffa5a For RS3, tasks connected to a swarm network will have 1 endpoint .
Signed-off-by: Pradip Dhara <pradipd@microsoft.com>
2017-08-09 14:13:59 -07:00
Derek McGowan
710e0664c4 Update logrus to v1.0.1
Fix case sensitivity issue
Update docker and runc vendors

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-08-07 11:20:47 -07:00
Flavio Crisciani
2e38c53def PeerInit for the sandbox init
Move the sandbox init logic into the go routine that handles
peer operations.
This is to avoid deadlocks in the use of the pMap.Lock for the
network

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-08-05 12:07:31 -07:00
Flavio Crisciani
5c52ff49e0 Funnel peerAdd and peerDelete in a channel
Remove the need for the wait group and avoid new
locks
Added utility to print the method name and the caller name

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-08-05 12:07:31 -07:00
Flavio Crisciani
b8d514432d Revert "Avoid peerUpdate logic in swarm mode"
This reverts commit b65a4ee10e.

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-08-05 12:07:16 -07:00
Flavio Crisciani
b65a4ee10e Avoid peerUpdate logic in swarm mode
Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-08-02 15:29:12 -07:00
Flavio Crisciani
d261ccb89f Revert "Funnel peerAdd and peerDelete in a channel"
This reverts commit fee89e0490.

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-08-02 15:29:05 -07:00
Flavio Crisciani
fee89e0490 Funnel peerAdd and peerDelete in a channel
Remove the need for the wait group and avoid new
locks
Added utility to print the method name and the caller name

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-07-31 09:15:55 -07:00
Madhu Venugopal
7a064d0ec0 Merge pull request #1842 from sanimej/arp
Attempt neighbor entry reprogramming on L3 miss
2017-07-28 00:27:58 -07:00
Flavio Crisciani
daba67d67b Avoid flakiness of TestLinkContainers
Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-07-21 13:54:19 -07:00
Santhosh Manohar
a50e885121 When the gc_thresh3 value is reached kenel might remove existing
neighbor entries. On an l3 miss try to reprogram the neighbor entry
if the peer is valid. Its a best effort attempt because if the arp
table is still at gc_thresh3 value, addition will fail.

Signed-off-by: Santhosh Manohar <santhosh@docker.com>
2017-07-13 17:01:30 -07:00
Madhu Venugopal
d01e1d38c3 Merge pull request #1755 from msabansal/msabansal/ics
Changes to support ICS network on windows
2017-07-07 18:28:13 +05:30
Sandeep Bansal
2d278dece0 Fixes docker daemon not restarting after endpoint leak on windows with transaprent network
Signed-off-by: Sandeep Bansal <sabansal@microsoft.com>
2017-06-15 13:27:48 -07:00
Flavio Crisciani
65860255c6 Fixed code issues
Fixed issues highlighted by the new checks

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-06-12 11:31:35 -07:00
Flavio Crisciani
233aa636d7 Fix OS tweaks call
The feature was not getting properly triggered, move it as
first operation in the configure

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-06-06 20:30:41 -07:00
Flavio Crisciani
d5c69190d1 Fix leak of watchMiss goroutine
The netlink socket that was used to monitor the L2
miss was never being closed. The watchMiss goroutine
spawned was never returning. This was causing goroutine
leak in case of createNetwork/destroyNetwork

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-06-06 09:24:21 -07:00
Madhu Venugopal
d65565610f Merge pull request #1781 from fcrisciani/vxlan-issue
Removed printfs
2017-06-05 19:24:41 -07:00
Madhu Venugopal
54d627c69d Merge pull request #1792 from sanimej/mac2
Remove dynamic mac entry from fdb on endpoint deletion
2017-06-05 16:30:08 -07:00
Flavio Crisciani
4abd54d419 Set kernel specific config on linux
On linux systems bump up gc_thresholds so to lower the
probability of running with neighbor table overflow issues

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-06-02 21:00:56 -07:00
Santhosh Manohar
e49955988a Remove dynamic mac entry from fdb on endpoint deletion
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
2017-06-01 12:20:46 -07:00
Flavio Crisciani
ae9f1f9f04 Removed printfs
Changed some prints into proper logging, also
was missing the \n at the end

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-05-26 14:13:26 -07:00
Sandeep Bansal
6d7e9ea6b4 Changes to support ICS network on windows
Signed-off-by: Sandeep Bansal <sabansal@microsoft.com>
2017-05-18 13:45:38 -07:00
Santhosh Manohar
98447449de Merge pull request #1675 from wenjianhn/forward-top
Add a filter chain to allow persistent rules
2017-05-16 22:47:59 -07:00
Sandeep Bansal
f566d6384e Added persistence to windows driver so that cleanup happens properly
Signed-off-by: Sandeep Bansal <sabansal@microsoft.com>
2017-05-16 14:06:43 -07:00
Jacob Wen
c348cebe99 Add a filter chain to allow persistent rules
Allow users to configure firewall policies in a way that persists
docker operations/restarts. Docker will not delete or modify any
pre-existing rules from the DOCKER-USER filter chain. This allows
the user to create in advance any rules required to further
restrict access from/to the containers.

Fixes docker/docker#29184
Fixes docker/docker#23987
Related to docker/docker#24848

Signed-off-by: Jacob Wen <jian.w.wen@oracle.com>
2017-05-16 10:24:56 +08:00
Alessandro Boch
ece544627b Adding manager pkg for swarm visible network drivers
- Orchestrator interaction with the network driver is limited
  to at most allocation/release of simple resources. For local scope
  drivers all what is needed is the retrieval of the driver scope.The
  full driver code base does not need to be pulled into the orschestrator.
  This PR introduces a dedicated package in each builtin nw
  driver for that purpose, as it was done for overlay driver.

Signed-off-by: Alessandro Boch <aboch@docker.com>
2017-05-12 17:16:54 -07:00
Alessandro Boch
254d082cc3 Add ConnectivityScope capability for network drivers along with scope network option
- It specifies whether the network driver can
  provide containers connectivity across hosts.
- As of now, the data scope of the driver was
  being overloaded with this notion.
- The driver scope information is still valid
  and it defines whether the data allocation
  of the network resources can be done globally
  or only locally.
- With the scope network option, user can now
  force a network as swarm scoped
  regardless of the driver data scope.
- In case the network is configured as swarm scoped,
  and the network driver is multihost capable,
  a network DB instance will be launched for it.

Signed-off-by: Alessandro Boch <aboch@docker.com>
2017-05-12 17:16:34 -07:00
Aaron Lehmann
cc0b7e6aad all: Avoid trivial uses of Sprintf
Use the string concatenation operator instead of using Sprintf for
simple string concatenation. This is usually easier to read, and allows
the compiler to detect problems with the type or number of operands,
which would be runtime errors with Sprintf.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2017-05-09 16:07:09 -07:00
Flavio Crisciani
3684df4a66 Flush container flows in conntrack (Bug #8795)
Flush all the endpoint flows when the external
connectivity is removed.
This will prevent issues where if there is a flow
in conntrack this will have precedence and will
let the packet skip the POSTROUTING chain.

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-04-07 18:30:45 -07:00
Santhosh Manohar
9dc694de18 Always program the kernel state if triggered by l2 or l3 miss
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
2017-03-16 18:12:52 -07:00
Santhosh Manohar
83837617b4 Handle kernel's l2miss notification in the overlay driver
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
2017-03-16 12:17:19 -07:00
Madhu Venugopal
00f1f12906 Merge pull request #1667 from wnagele/master
Support for com.docker.network.bridge.container_interface_prefix label
2017-03-13 07:46:56 -07:00
Madhu Venugopal
c85473ad37 Merge pull request #1354 from aboch/pol
Few changes in encryption overlay
2017-03-11 18:21:55 -08:00
Alessandro Boch
9272c89bb7 Clear encryption states when joining cluster
- Use the request id for labelling our SAs

Signed-off-by: Alessandro Boch <aboch@docker.com>
2017-03-11 15:52:39 -08:00
Santhosh Manohar
bfab379411 swarm mode network inspect should provide cluser-wide task details
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
2017-03-10 19:12:00 -08:00
Santhosh Manohar
b2430cc299 Merge pull request #961 from JrCs/fix-iptables-order
Fix bad order of iptables filter rules
2017-03-05 20:28:22 -08:00
Wolfgang Nagele
d07e1a02a4 Support for com.docker.network.bridge.container_interface_prefix label
Signed-off-by: Wolfgang Nagele <mail@wnagele.com>
2017-03-01 03:09:45 +01:00
Santhosh Manohar
8288090b19 Merge pull request #1658 from aboch/iptlck
Serialize non-atomic jump rule programming in bridge
2017-02-22 11:04:37 -08:00
Alessandro Boch
138c4b2a77 Serialize non-atomic jump rule programming in bridge
Signed-off-by: Alessandro Boch <aboch@docker.com>
2017-02-22 08:35:26 -08:00
Alessandro Boch
91f5b1669e Once a network is encrypted, do not accept clear packets from it
Signed-off-by: Alessandro Boch <aboch@docker.com>
2017-02-18 12:15:54 -08:00
Madhu Venugopal
1b8c4b421b Merge pull request #1636 from msabansal/overlayfix
Cleaning up windows overlay network driver code and making it rely on HNS network information
2017-02-14 11:03:07 -08:00
Madhu Venugopal
962d13481c Merge pull request #1644 from sanimej/self
Update the local VTEP in peerdb on receiving self discovery
2017-02-10 22:27:10 -08:00
Alessandro Boch
4a04857a68 Fix bug in datapath key rotation in 1-1 NAT case
- It was not using the advertise IP to construct the SPI

Signed-off-by: Alessandro Boch <aboch@docker.com>
2017-02-10 18:33:06 -08:00
Santhosh Manohar
4208a2f75a Update the local VTEP in peerdb on receiving self discovery
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
2017-02-10 14:24:24 -08:00
msabansal
66895dfdfc Clearing up windows overlay driver to just work in swarm mode
Signed-off-by: msabansal <sabansal@microsoft.com>
2017-02-08 11:49:44 -08:00
Alessandro Boch
1ee6e5b30b Merge pull request #1639 from sanimej/serf
Ignore previous serf user events to avoid wrong fdb programming
2017-02-07 12:30:34 -08:00
Madhu Venugopal
82a40d732f Merge pull request #1638 from aboch/ovlk
Do not hold the peer map lock during the peerDBNetworkWalk
2017-02-07 12:22:19 -08:00
Santhosh Manohar
e94edd6d6b Ignore previous serf user events to avoid wrong fdb programming
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
2017-02-07 12:14:23 -08:00
Alessandro Boch
dd10eb794c Do not hold the peer map lock during the peerDBNetworkWalk
Signed-off-by: Alessandro Boch <aboch@docker.com>
2017-02-07 10:08:05 -08:00
Alessandro Boch
adb8720634 Report failure in subscribing to neighbor notifications
- currently it is silenced

Signed-off-by: Alessandro Boch <aboch@docker.com>
2017-02-05 20:19:02 -08:00
Alessandro Boch
bee7d9219f Properly construct CIDR in policy selector
- Current code programs src/dst cidr like 192.168.100.126/128

Signed-off-by: Alessandro Boch <aboch@docker.com>
2017-02-03 23:14:58 -08:00
Alessandro Boch
5713ca4694 Remove stale files
Signed-off-by: Alessandro Boch <aboch@docker.com>
2017-01-25 23:10:14 -08:00
realityone
d94be29ec5 return an error on overlay subnet is overlapped with hosts
Signed-off-by: realityone <realityone@me.com>
2017-01-05 11:22:00 +08:00
Santhosh Manohar
f2f0212cab Merge pull request #1599 from mavenugo/v0.9
Make use of GetAllManagedPluginsForCap to avoid loading v1-plugins
2017-01-04 15:02:06 -08:00
Madhu Venugopal
c6dfc70b33 Make use of GetAllManagedPluginsForCap to avoid loading v1-plugins
Read this for more details : https://github.com/docker/docker/pull/29665

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2017-01-04 14:35:42 -08:00
Alessandro Boch
64002895a5 Merge pull request #1604 from allencloud/fix-nits-in-comments
fix nits in error and log
2016-12-29 12:20:04 -08:00
Alessandro Boch
595246bdfb Merge pull request #1568 from likel/refactor
Remove unnecessary string formats
2016-12-29 12:18:06 -08:00
allencloud
bc85efdb4f fix nits in comments
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-12-28 18:49:18 +08:00
Madhu Venugopal
1b28c5e01d Internal interface to differentiate built-in drivers from remote
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2016-12-19 05:17:42 -08:00
Madhu Venugopal
bc45d84e8d Handle the case of registering active plugins during remote init
With Plugin-V2, plugins can get activated before remote driver is
Initialized. Those plugins fails to get registered with drvRegistry.

This fix handles that scenario

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2016-12-16 08:38:55 -08:00
Madhu Venugopal
48c4c81cb1 Merge pull request #1567 from daehyeok/logrus_formating
Refactoring logrus import and formatting
2016-12-02 16:02:57 -08:00
Madhu Venugopal
224a73d60b Merge pull request #1576 from daehyeok/misspell
Fixed misspelling
2016-12-02 16:02:23 -08:00
Daehyeok Mun
f89d6b0073 Fixed misspelling
Signed-off-by: Daehyeok Mun <daehyeok@gmail.com>
2016-11-28 11:46:52 -07:00
Madhu Venugopal
5217602776 Create vxlan-id space from 0 instead of starting from 1
With the introduction of GetIDInRange function in IDM and using it in
ovmanager, the idm.New was modified to start from 1. But that causes
issues when the network is removed which results in releasing the
vxlan-id from IDM. With the offset of 1, the Release call incorrectly
releases a bit which could be in use by another network and this results
in the infamous "error creating vxlan interface: file exists" errors
when another network is created with this freed bit.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2016-11-25 13:02:03 -08:00
Ke Li
23ac56fdd0 Remove unnecessary string formats
Signed-off-by: Ke Li <kel@splunk.com>
2016-11-22 09:29:53 +08:00
Daehyeok Mun
0f745fbb23 Refactoring logrus import and formatting
Fix import name to use original project name 'logrus' instead of 'log'
Removing `f` from `logrus.Debugf` when formatting string is not present.

Signed-off-by: Daehyeok Mun <daehyeok@gmail.com>
2016-11-21 11:53:07 -07:00
Alessandro Boch
763f0fa1da Set a timeout on the netlink handle sockets
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-11-15 12:08:36 -08:00
Alessandro Boch
5b4059e087 Fix new golint reported errors
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-11-14 16:41:54 -08:00
Madhu Venugopal
5040d8ccd7 Merge pull request #1526 from sanimej/policy
when enabling ip forwarding set the default forward policy to drop
2016-11-10 10:12:26 -08:00
Madhu Venugopal
1066f9ed5c IDM need not be bound by default vxlan-id start index
This will allow users to use the full spectrum of vxlan-ids

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2016-11-09 14:42:54 -08:00
Madhu Venugopal
1b8698e148 Merge pull request #1541 from msabansal/defaultgw
Default GW support for overlay networks
2016-11-08 14:34:26 -08:00
msabansal
261fedba8c Default GW support for overlay networks
Signed-off-by: msabansal <sabansal@microsoft.com>
2016-11-08 14:12:29 -08:00
Daehyeok Mun
7f473c779a Refactoring logrus import and formatting
This fix tries to fix logrus formatting by removing `f` from
`logrus.[Error|Warn|Debug|Fatal|Panic|Info]f` when formatting string
is not present.
Also fix import name to use original project name 'logrus' instead of
'log'

Signed-off-by: Daehyeok Mun <daehyeok@gmail.com>
2016-11-08 12:42:41 -07:00
Alessandro Boch
734f4ec86d Merge pull request #1514 from puneetpruthi/overlay_support
Overlay driver support for Solaris
2016-11-03 21:57:05 -07:00
Santhosh Manohar
9f2ecdcd9d If enabling ip forwarding set the default forward policy to drop
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
2016-11-03 20:38:43 -07:00
Madhu Venugopal
3e11ddc4d9 Change vxlan-id start-idx to 4096
To make it consistent with windows and linux workers

Signed-off-by: Madhu Venugopal <madhu@docker.com>

Fixed build breaks

Signed-off-by: msabansal <sabansal@microsoft.com>
2016-11-03 16:50:15 -07:00
Madhu Venugopal
d1b012d97a Windows overlay driver support
1. Base work was done by msabansal and nwoodmsft
   from : https://github.com/msabansal/docker/tree/overlay
2. reorganized under drivers/windows/overlay and rebased to
   libnetwork master
3. Porting overlay common fixes to windows driver
    * 46f525c
    * ba8714e
    * 6368406
4. Windows Service Discovery changes for swarm-mode
5. renaming default windows ipam drivers as "windows"

Signed-off-by: Madhu Venugopal <madhu@docker.com>
Signed-off-by: msabansal <sabansal@microsoft.com>
Signed-off-by: nwoodmsft <Nicholas.Wood@microsoft.com>
2016-11-03 16:50:04 -07:00
Santhosh Manohar
a00cb33ae0 Merge pull request #1525 from aboch/icc
Respect icc option for internal networks
2016-11-02 16:50:58 -07:00
Jana Radhakrishnan
ea579a4d0e Merge pull request #1477 from allencloud/fix-nits-in-comments
fix nits in comments and log
2016-11-02 09:58:18 -07:00
allencloud
a1ed5b7be2 fix nits in comments and log
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-10-29 19:35:18 +08:00
Alessandro Boch
4218a0a650 Respect icc option for internal networks
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-10-28 11:42:50 -07:00
Alessandro Boch
b834dfcfa0 Merge pull request #1452 from yongtang/26341-fixed-cidr-multiple-addresses-bridge
Fix issue for `--fixed-cidr` when bridge has multiple addresses
2016-10-26 12:52:19 -07:00
Alessandro Boch
15c13e5169 Merge pull request #1333 from coolljt0725/cleanup_driver_endpoint
Remove driver endpoints on network deleting
2016-10-26 12:51:41 -07:00
Yong Tang
53bf987984 Fix issue for --fixed-cidr when bridge has multiple addresses
This fix tries to address the issue raised in:
https://github.com/docker/docker/issues/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 changes `ElectInterfaceAddresses()` and `addresses()`
so that all IPv4 addresses are returned. This will allow the
possibility of selectively choose the address needed.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-10-21 13:58:16 -07:00
Puneet Pruthi
ef50edefde overlay driver support for Solaris
Signed-off-by: Puneet Pruthi <puneetpruthi@gmail.com>
2016-10-18 18:58:51 -07:00
Puneet Pruthi
a48b541da3 libnetwork support for Solaris
Signed-off-by: Puneet Pruthi <puneetpruthi@gmail.com>
2016-10-14 16:38:23 -07:00
Lei Jitang
433e3dfe98 Remove driver endpoints on network deleting
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2016-10-14 10:05:20 +08:00
Alessandro Boch
cff2573d1f Reset endpoint port info on connectivity revoke in bridge driver
- and update it to store. Otherwise after an ungraceful shutdown,
  at next boot there will be in store two bridge endpoints with
  same port-mapping data. When bridge driver will try to restore
  the endpoints, there will be conflicts and a container with
  restart policy could fail to start.

Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-10-12 13:02:47 -07:00
Alessandro Boch
eb02cb999b Merge pull request #1500 from anusha-ragunathan/update_path
Update plugingetter import path.
2016-10-07 13:25:42 -07:00
Anusha Ragunathan
5c77ba43e2 Update plugingetter import path.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-10-07 12:00:57 -07:00
Madhu Venugopal
b48e25b44f Add support for NetworkAllocate and NetworkFree in remote driver
Also added an API to return list of builtin network drivers

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2016-10-05 18:20:02 -07:00
Alessandro Boch
c609dfcfe7 Merge pull request #1466 from rony36/master
Fix macvlan private mode argument vaildation
2016-10-03 10:54:43 -07:00
Madhu Venugopal
59832beb31 Merge pull request #1470 from runcom/proxy-path
bridge,portmapper: custom docker-proxy path
2016-09-29 14:43:40 -07:00
Anusha Ragunathan
003e04775b Make libnetwork understand pluginv2.
As part of daemon init, network and ipam drivers are passed a
pluginstore object that implements the plugin/getter interface. Use this
interface methods in libnetwork to interact with network plugins. This
interface provides the new and improved pluginv2 functionality and falls
back to pluginv1 (legacy) if necessary.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-09-27 15:29:10 -07:00
Antonio Murdaca
38338863dc bridge,portmapper: custom docker-proxy path
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-09-25 18:07:58 +02:00
ronyweng
bd7fc6431b Fix macvlan private mode argument vaildation
Signed-off-by: Rony Weng <ronyweng@synology.com>
2016-09-23 18:57:42 +08:00
Jana Radhakrishnan
d6e596b3a0 Serialize overlay filter plumbing
When plumbing overlay filter rules serialize this to make sure that
multiple sandbox join or leave is not causing erroneous behavior while
moving the RETURN rule in the predefined chains.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-09-22 17:50:19 -07:00
Madhu Venugopal
9fae5d1779 Merge pull request #1412 from msabansal/dnsv2
DNS support for Windows
2016-09-20 17:35:26 -07:00
msabansal
7f43fd30f3 DNS support
Signed-off-by: msabansal <sabansal@microsoft.com>
2016-09-20 13:02:02 -07:00
Alessandro Boch
d4f3963a26 In overlay driver reset any state on setkey()
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-09-19 14:03:55 -07:00
Santhosh Manohar
04f63f7923 Merge pull request #1433 from mrjana/overlay
Ensure purging neighbor cache for stale deletes
2016-09-16 13:32:06 -07:00
Michael Holzheu
8d63e73522 Revert "add s390x arch build info at the netlink_deprecated_linux bridge driver"
This reverts commit b042dbe312.

The original commit breaks s390x, for example Docker build fails:

 * https://github.com/docker/docker/issues/26440

As discussed in the above issue:

  Even though char is unsigned by default on s390x, (gcc)go forces the type
  of RawSockaddr.Data to be signed.

  It makes no practical difference if these fields are signed or unsigned,
  it's just an API issue.

  The (assumed) reason for the original commit:

  For a while RawSockaddr.Data was unsigned during development of the gcc
  s390x port (not in an upstream release though). Probably the patch has
  been developed in this time frame.

Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
2016-09-09 18:04:45 +02:00
Chun Chen
71b8749971 Merge pull request #1301 from mountkin/keep-custom-bridge
don't delete the bridge interface if it was not created by libnetwork
2016-09-08 10:27:44 +08:00
Jana Radhakrishnan
ad10ae9b3b Move engine-api to docker/docker/api
Remove all dependencies to engine-api and start using docker/docker/api.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-09-07 14:38:45 -07:00
Jana Radhakrishnan
2ba6c399ea Ensure purging neighbor cache for stale deletes
When stale delete notifications are received, we still need to make sure
to purge sandbox neighbor cache because these stale deletes are most
typically out of order delete notifications and if an add for the
peermac was received before the delete of the old peermac,vtep pair then
we process that and replace the kernel state but the old neighbor state
in the sandbox cache remains. That needs to be purged when we finally
get the out of order delete notification.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-09-07 10:45:40 -07:00
Shijiang Wei
6bd15397b2 don't delete the bridge interface if it was not created by libnetwork
Signed-off-by: Shijiang Wei <mountkin@gmail.com>
2016-09-07 14:08:08 +08:00
Shijiang Wei
6205a5d616 make sure the user-provided bridge interface is a bridge
Signed-off-by: Shijiang Wei <mountkin@gmail.com>
2016-09-06 13:14:58 +08:00
Alessandro Boch
f88765e4e6 Merge pull request #1198 from jordimassaguerpla/add_s390x
add s390x arch build info at the netlink_deprecated_linux bridge driver
2016-09-02 22:54:48 +02:00
Madhu Venugopal
e174a7c9f2 Merge pull request #1428 from aboch/sto
Cleanup on error in ProgramExternalConnectivity
2016-09-02 11:54:38 -07:00
Santhosh Manohar
cbf681044f Merge pull request #1369 from aboch/ovl
Allow reattempt of overlay network sbox join
2016-09-02 11:05:32 -07:00
Alessandro Boch
bace4fb6ff Cleanup on error in ProgramExternalConnectivity
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-09-02 11:01:06 -07:00
Santhosh Manohar
ba8714e585 Propage the vxlan device creation error in driver to libnetwork
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
2016-08-21 15:52:40 -07:00
Madhu Venugopal
c7d98e0081 Merge pull request #1382 from mrjana/overlay
Fix spurious overlay errors
2016-08-11 11:38:57 +05:30
Jana Radhakrishnan
b7fe572598 Merge pull request #1376 from technolo-g/master
Fix typo in error message
2016-08-08 11:58:13 -07:00
Jana Radhakrishnan
004e56a4d1 Fix spurious overlay errors
Fixed certain spurious overlay errors which were not errors at all but
showing up everytime service tasks are started in the engine.

Also added a check to make sure a delete is valid by checking the
incoming endpoint id wih the one in peerdb just to make sure if the
delete from gossip is not stale.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-08-08 11:55:06 -07:00
Alexander Morozov
09da6a6f59 overlay: fix data race in map access
Signed-off-by: Alexander Morozov <lk4d4math@gmail.com>
2016-08-05 14:40:23 -07:00
Matt Bajor
d19e1f22cb Fix typo in error message
Signed-off-by: Matt Bajor <matt@notevenremotelydorky.com>
2016-08-04 15:58:39 -06:00
Jana Radhakrishnan
8825f80d8c Merge pull request #1366 from allencloud/fix-typo-in-comment-and-log
fix typo in comments and log
2016-08-01 09:50:26 -07:00
Jana Radhakrishnan
8a225de00d Merge pull request #1205 from allencloud/fix-typos
use grep to find a/an misuse
2016-08-01 09:49:31 -07:00
Jana Radhakrishnan
b0f5f02224 Merge pull request #1284 from liubin/fix-typos
fix typos
2016-08-01 09:49:00 -07:00
Alessandro Boch
4f8c645173 Allow reattempt of overlay network sbox join
- if failure happened during restore endpoint phase

Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-08-01 08:08:51 -07:00
allencloud
d69747e19e fix typo in comments and log
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-07-30 02:21:10 +08:00
Madhu Venugopal
f142339334 Merge pull request #1356 from aboch/isb
Fix bug in ipsec key rotation
2016-07-25 19:16:01 -07:00
Alessandro Boch
bc6a60dae5 Fix bug in ipsec key rotation
- which would leave a stale state behind
  at each key rotation.

Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-07-25 16:23:53 -07:00
Alessandro Boch
8bc99ae906 Check for advertise IP when deriving ipsec nodes
- We need to compare the node notification IP with
  the advertise address otherwise when the advertise
  address is different from the local address (this
  is for the public address outside of the host
  that maps 1-to-1 to the local private address)
  the local IP will be acocunted as an ipsec host
  and extra states will be programmed for it.

Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-07-25 12:07:48 -07:00
Madhu Venugopal
cd8a75e237 Merge pull request #1350 from aboch/ipsec
On network creation, reset mangle rule
2016-07-24 08:54:50 -07:00
Alessandro Boch
147b646e79 On network creation, reset mangle rule
- When creating a non encrypted overlay network,
  make sure no encryption related mangle rule from
  stale network is on the way.

Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-07-24 08:25:47 -07:00
Alessandro Boch
801bd7b3b2 Allow user to set the overlay network's mtu
- Being a driver specific flag, user needs to
  account for vxlan and, if enabled, ipsec overhead

Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-07-23 22:39:29 -07:00
Alessandro Boch
e415b1f495 Do not use 4 byte ip addresses in encryption code
- Because of a bug in the netlink xfrm code, our code will
  fail to find and remove the states. While we could wait
  for the netlink library fix, there is no longer a need to
  convert the parsed IP addresses to the canonical notation
  given the previous SPI computation (which worked on that
  4 byte address assumption) is now replaced by the fnv hash.
- Also modify driver option that enables ipsec to "encrypted"

Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-07-23 19:00:47 -07:00
Jordi Massaguer Pla
b042dbe312 add s390x arch build info at the netlink_deprecated_linux bridge driver
Signed-off-by: Jordi Massaguer Pla <jmassaguerpla@suse.de>
2016-07-22 12:30:16 +02:00
Alessandro Boch
6b486d88e6 Merge pull request #1337 from mavenugo/adv-addr
Add advertise-addr support
2016-07-21 09:51:51 -07:00
Madhu Venugopal
6368406c26 Adding Advertise-addr support
With this change, all the auto-detection of the addresses are removed
from libnetwork and the caller takes the responsibilty to have a proper
advertise-addr in various scenarios (including externally facing public
advertise-addr with an internal facing private listen-addr)

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2016-07-21 02:44:25 -07:00
Madhu Venugopal
46caa4c813 Merge pull request #1339 from aboch/sec
Adjust container's veth MTU when encryption is on
2016-07-21 01:43:18 -07:00
Madhu Venugopal
9b822c3fc6 Merge pull request #1327 from aboch/aead
Use Authenticated Encryption for dataplane encryption
2016-07-20 17:36:31 -07:00
Alessandro Boch
6aa25f33d4 Adjust container's veth MTU when encryption is on
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-07-20 17:13:05 -07:00
Alessandro Boch
ddff1b5a87 Use fnv1-a to construct the SPI
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-07-20 12:50:33 -07:00
Alessandro Boch
253c103b8c Use aead for dataplane encryption
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-07-19 11:48:28 -07:00
Lei Jitang
744d5332bd ipvlan: remove endpoint from network on deleting endpoint
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2016-07-19 00:06:46 -04:00
Alessandro Boch
46f525c7d6 Overlay driver to cleanup stale endpoints
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-07-13 10:56:57 -07:00
Andy Lindeman
f2ae8467e3 Avoids panic when checking for conflicts against an uninitalized network
A network is added to the `d.networks` map before it's fully initialized. That
is, it's possible for a network in `d.networks` to exist without having
`bridgeIPv4` populated yet. If multiple networks are spun up close to the same
time, a panic can occur.

Example:
```
panic(0x1a75d20, 0xc82000e090)
        /usr/local/go/src/runtime/panic.go:443 +0x4e9
net.networkNumberAndMask(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
        /usr/local/go/src/net/ip.go:433 +0x42
net.(*IPNet).Contains(0x0, 0xc82084dbd0, 0x4, 0x4, 0xc820010200)
        /usr/local/go/src/net/ip.go:457 +0x25
github.com/docker/libnetwork/drivers/bridge.(*networkConfiguration).conflictsWithNetworks(0xc822249360, 0xc822761380, 0x40, 0xc820866a60, 0x4, 0x4, 0x0, 0x0)
        /root/rpmbuild/BUILD/docker-engine/vendor/src/github.com/docker/libnetwork/drivers/bridge/bridge.go:334 +0x40b
```

Signed-off-by: Andy Lindeman <alindeman@salesforce.com>
2016-07-07 11:27:12 -04:00
Jana Radhakrishnan
de766cc7e6 ovmanager: Error out on vxlan id alloc failure
Currently ovmanager simply logs an error when there is a vni allocation
failure. Instead it should error out and free all the previously
allocated vnis

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-06-28 13:46:22 -07:00
Brian Goff
3925ea0a2d Fix panic calling ep instead of endpoint
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-06-27 13:25:20 -04:00
Alessandro Boch
5146f05b33 Do not error on non discovery type messages in remote driver
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-06-25 16:23:11 -07:00
Jana Radhakrishnan
d3b8412ac6 Update ovmanager to support maximum vni
To support maximum possible overlay networks in swarm mode.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-06-24 16:41:53 -07:00
Aaron Lehmann
91e8d5bfb9 Fix sanbox typo
Change "sanbox" to "sandbox".

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-06-24 15:14:01 -07:00
bin liu
5f7577bbb4 fix typos
Signed-off-by: bin liu <liubin0329@gmail.com>
2016-06-22 14:20:30 +08:00
Alessandro Boch
117131c41b Gracefully handle missing xfrm modules
If xfrm modules cannot be loaded:
- Create netlink.Handle only for ROUTE socket
- Reject local join on overlay secure network

Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-06-20 17:25:32 -07:00
Santhosh Manohar
8ded762a0b Update key handling logic to process keyring with 3 keys
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
2016-06-11 04:50:25 -07:00
Alessandro Boch
c963031a44 Bridge driver to detect and remove stale network
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-06-16 11:14:00 -07:00
Alessandro Boch
48739b5868 Reduce overlay encryption log noise
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-06-15 09:25:28 -07:00
sainath
e2b0934ac2 Delete endpoint from network map for macvlan driver upon endpoint deletion
Signed-off-by: Sainath Grandhi <sainath.grandhi@intel.com>
2016-06-14 13:50:43 -07:00
Santhosh Manohar
2e9c30a4a1 Persist and restore overlay endpoints to handle daemon restart
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
2016-06-13 23:48:00 -07:00
Alessandro Boch
41ca84c950 Populate nlHandle and use it on netns restore
- also in overlay/encryprion.go

Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-06-13 23:48:00 -07:00
Alessandro Boch
8ca4ed0c68 IPvlan and macvlan driver to persist endpoints
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-06-13 23:48:00 -07:00
Alessandro Boch
c63b7b005f Bridge driver to persist endpoints
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-06-13 23:48:00 -07:00
Lei Jitang
055c5dd496 Add network restore to support docker live restore container
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2016-06-13 23:48:00 -07:00
Jana Radhakrishnan
c79a49235d Purge vniTbl after cleaning up network sandbox
If we cleaned up a stale network sandbox and an entry for that exists in
vniTbl, then purge it from vniTbl. Otherwise when a new vxlan for that
vni is added to the network, we might destroy the network sandbox
created in the current life.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-06-13 00:09:05 -07:00
Jana Radhakrishnan
96b424b9b8 Process only misses on IP belonging to network
If a miss notification arrives on a network's miss go routine currently
it is unconditionally processed. This is unnecessary and can be bad if
there are too many misses. This is especially true for hostmode. Fix
this by filtering out misses that doesn't belong to any of the network's
subnets.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-06-11 22:55:22 -07:00
Madhu Venugopal
0deffeac4b Cleanup any stale overlay bridge with overlapping subnet in hostMode
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2016-06-10 08:32:31 -07:00
Jana Radhakrishnan
f65ae3c742 Fix panic if miss notification sock is nil
Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-06-09 17:02:45 -07:00
Jana Radhakrishnan
a95260646a Allow maximum possible VNI
Right now there is an artificial limitation at 1000.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-06-09 12:50:31 -07:00
Madhu Venugopal
bb4798d669 Merge pull request #1174 from aboch/hnd-migr
Migrate libnetwork to use netlink.Handle
2016-06-09 10:18:54 -07:00
Santhosh Manohar
a398810a14 Merge pull request #1199 from aboch/sec
Overlay driver to support network layer encryption
2016-06-09 10:17:37 -07:00
Alessandro Boch
93b5073a7d Overlay driver to support network layer encryption
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-06-08 23:38:55 -07:00
Alessandro Boch
6d3fa9e0f2 Migrate libnetwork to use netlink.Handle
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-06-08 21:05:36 -07:00
Madhu Venugopal
a2cc703dae Overlay driver's NetworkAllocate method must honor driver options
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2016-06-08 02:40:28 -07:00
Jana Radhakrishnan
fdc385573c Do not plumb local peers as remote peers
In the current implementation, the local peers are being added as remote
peers so gets added to the vxlan neighbor and fdb table. This causes the
local forwarding to get stuck for a few seconds after the bridge mac
table entries for the local peers get aged out. This PR fixes the
problem.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-06-06 22:58:28 -07:00
Jana Radhakrishnan
6e47b07b39 Cleanup vxlan interfaces inside namespace
If a new network request is received for a prticular vni, cleanup the
interface with that vni even if it is inside a namespace. This is done
by collecting vni to namespace data during init and later using it to
delete the interface.

Also fixed a long pending issue of the vxlan interface not getting
destroyed even if the sandbox is destroyed. Fixed by first deleting the
vxlan interface first before destroying the sandbox.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-06-06 01:31:47 -07:00
allencloud
9f415d0cdb use grep to find a/an misuse
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-06-03 16:35:33 +08:00
allencloud
de588f950d fix typos
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-05-30 18:20:52 +08:00
Jana Radhakrishnan
dec79c21f2 Convert overlay peer updates to use protobuf
Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-05-18 20:44:50 -07:00
Alessandro Boch
b52748bb26 Vendoring vishvananda/netlink f9bc7a684edbe780a09b87689db6cb1706bf327f
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-05-16 11:08:47 -07:00
Santhosh Manohar
63cc2ecf78 Merge pull request #1149 from mrjana/agent
Add libnetwork agent mode support
2016-05-05 14:33:35 -07:00
Jana Radhakrishnan
0580043718 Add libnetwork agent mode support
libnetwork agent mode is a mode where libnetwork can act as a local
agent for network and discovery plumbing alone while the state
management is done elsewhere. This completes the support for making
libnetwork and its associated drivers to be completely independent of a
k/v store(if needed) and work purely based on the state information
passed along by some some external controller or manager. This does not
mean that libnetwork support for decentralized state management via a
k/v store is removed.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-05-02 18:19:32 -07:00
Alessandro Boch
57a91d9153 Merge pull request #1131 from msabansal/staticip
Static ip support for windows
2016-04-29 12:09:09 -07:00
Jana Radhakrishnan
b1d422b6b5 Make overlay driver work without a kv store
Currently overlay driver requires a k/v store to allocate a vxlan id and
add an entry in k/v store for network->vxlanIDs binding. But the overlay
driver should be able to work without a k/v store provided libnetwork
can pass along the vxlanIDs needed for the network, rather than the
driver managing it themselves. Modified the driver to work with vxlanIDs
passed down by libnetwork.

Also made changes in the driver to make use of the gossip layer
available in libnetwork if available.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-04-28 17:12:01 -07:00
msabansal
43a2b083e8 Static ip support for windows
Signed-off-by: msabansal <sabansal@microsoft.com>
2016-04-20 15:44:32 -07:00
Jana Radhakrishnan
6fb69f0816 Add driver api enhancements for gossip
With the introduction of a driver generic gossip in libnetwork it is not
necessary for drivers to run their own gossip protocol (like what
overlay driver is doing currently) but instead rely on the gossip
instance run centrally in libnetwork. In order to achieve this, certain
enhancements to driver api are needed. This api aims to provide these
enhancements.

The new api provides a way for drivers to register interest on table
names of their choice by returning a list of table names of interest as
a response to CreateNetwork. By doing that they will get notified if a
CRUD operation happened on the tables of their interest, via the newly
added EventNotify call.

Drivers themselves can add entries to any table during a Join call by
invoking AddTableEntry method any number of times during the Join
call. These entries lifetime is the same as the endpoint itself. As soon
as the container leaves the endpoint, those entries added by driver
during that endpoint's Join call will be automatically removed by
libnetwork. This action may trigger notification of such deletion to all
driver instances in the cluster who have registered interest in that
table's notification.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-04-18 19:55:39 -07:00
Yves Blusseau
6149b1f32f Fix bad order of iptables filter rules
Rules with ctstate RELATED,ESTABLISHED must be create before same
rules without ctstate.

Signed-off-by: Yves Blusseau <90z7oey02@sneakemail.com>
2016-04-16 18:42:13 +02:00
Alessandro Boch
216def1e1b Merge pull request #1120 from mrjana/store
Remove kvstore backend deps from datastore package
2016-04-15 15:50:46 -07:00
Jana Radhakrishnan
89e72d8888 Remove kvstore deps from datastore package
Currently datastore has dependencies on various kv backends.
This is undesirable if datastore had to be used as a backend
agnostic store management package with it's cache layer. This
PR aims to achieve that.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-04-15 15:36:44 -07:00
Alessandro Boch
c891a47cb3 Merge pull request #1095 from mrjana/ipam
Remove all netlink/osl deps from ipam/ipamutils
2016-04-15 11:46:47 -07:00
Jana Radhakrishnan
3c210335cd Merge pull request #1116 from sanimej/ov
Correct the check in l3 miss handling in overlay driver
2016-04-15 11:15:45 -07:00
Alessandro Boch
ccad8f64d3 Merge pull request #1111 from mrjana/ovmanager
Add overlay manager driver
2016-04-15 11:05:54 -07:00
Jana Radhakrishnan
c0162f53a6 Add overlay manager driver
Because overlay is a builtin driver and global allocation of overlay
resources is probably going to happen in a different node (a single
node) and the actual plumbing of the network is probably going to happen
in all nodes, it makes sense to split the functionality of allocation
into two different packages. The central component(this package) only
implements the NetworkAllocate/Free apis while the distributed
component(the existing overlay driver) implements the rest of the driver
api. This way we can reduce the memory footprint overall.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-04-14 10:37:42 -07:00