Commit Graph

30 Commits

Author SHA1 Message Date
Alessandro Boch 8ee94f8349 Make sure sandbox GC is started after live-restore
Signed-off-by: Alessandro Boch <aboch@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
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
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 4c1ed2010b Merge pull request #1228 from aboch/ll
Allow to program Endpoint link-local addresses
2016-06-08 18:17:42 -07:00
Alessandro Boch da61c5d37f Allow to program Endpoint link-local addresses
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-06-08 15:02:34 -07:00
allencloud de588f950d fix typos
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-05-30 18:20:52 +08:00
Alessandro Boch 84682eb59a Fix bug in osl.SetGatewayIPv6() function
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-04-28 12:49:40 -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
Amit Krishnan c7684b5ff7 Get libnetwork to build on Solaris
Signed-off-by: Amit Krishnan <krish.amit@gmail.com>
2016-04-14 14:03:50 -07:00
Jana Radhakrishnan b0d046a1af Remove all netlink/osl deps from ipam/ipamutils
Currently ipam/ipamutils has a bunch of dependencies
in osl and netlink which makes the ipam/ipamutils harder
to use independently with other applications. This PR
modularizes ipam/ipamutils into a standalone package
with no OS level dependencies.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-04-10 11:05:39 -07:00
Nalin Dahyabhai 937702b74d Format network address using %v instead of %p
If we encounter an error setting an interface's IPv4 or IPv6 address,
log the addresses we tried to use using the %v specifier rather than %q.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com> (github: nalind)
2016-03-16 17:23:13 -04:00
Madhu Venugopal 86db344e56 Merge pull request #803 from aboch/pm
Libnetwork to program container interface's MAC
2016-03-03 18:12:08 -08:00
Alessandro Boch 83f1107e59 Delete the interface on endpoint delete in overlay
- Attempt the veth delete only after both ends
  are moved into the default network namespace.
  Which is after both driver.Leave() and
  sandbox.clearNetworkResources() are called.

Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-01-29 16:04:14 -08:00
Alessandro Boch 31016faad5 Disable DAD for sandbox IPv6 addresses
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-01-05 16:51:10 -08:00
aboch f95f14d77b Merge pull request #821 from mrjana/overlay
Add overlay network support in < 3.16 kernels
2015-12-17 13:21:23 -08:00
Jana Radhakrishnan b7d0fefabc Add overlay network support < 3.16 kernels
Add support for overlay networking in older kernels.

Following were done to achieve this:
    + Create the vxlan network in host namespace.
    + This may create conflicts with other private
      networks so check for conflicts and fail a
      join if there is any conflict.
    + Add iptable based filtering to only allow
      subnet bridges in the same network to forward
      traffic while different network bridges will
      not be able to forward b/w each other. Also
      block traffic to overlay network originating
      from the host itself.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-12-17 10:17:03 -08:00
Alessandro Boch 6b40581ea5 Libnetwork to set container interface's MAC
- Consistently with what it does for IP addresses, libnetwork
  will also program the container interface's MAC address with
  the value set by network driver in InterfaceInfo.

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-12-04 16:56:46 -08:00
Miguel Perez 0ae6d496bd Allow libnetwork to compile on freebsd
Signed-off-by: Miguel Perez <miguel@voyat.com>
2015-11-26 10:10:09 -05:00
Madhu Venugopal caab594ffb Moved InterfaceStatistics from osl into types package
Exposing osl package outside libnetwork is not neccessary and the
InterfaceStatistics anyways belong to the types package.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-09-26 10:12:20 -07:00
Madhu Venugopal 69900c01d6 Merge pull request #543 from tomdee/settings-routes-after-up
Set interfaces routes after the interface is up
2015-09-17 18:02:41 -07:00
Tom Denham ba83cbc058 Set interfaces routes after the interface is up
Fixes #485

The code previously relied on an uninteded side effect. When the
interface name was set, this causes the interface to come up
prematurely. Once that side effect was removed, routes could
no longer be set.

This change ensures that routes are only set after the interface
is brought up.

Signed-off-by: Tom Denham <tom@tomdee.co.uk>
2015-09-17 16:05:25 -07:00
Phil Estes 437dfd3a43 Correct perms for directory creation
Directories should be 0755, not 0644

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
2015-09-17 15:19:23 -04:00
Jana Radhakrishnan 0e00550af4 Merge pull request #502 from mavenugo/sbox_uns
Support to provide external key to sandbox
2015-09-09 21:39:48 -07:00
Madhu Venugopal f59502e1bd Support to provide external key to sandbox
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-09-09 20:26:37 -07:00
Shijiang Wei aade3e7a92 remove the useless get netns code in createNetworkNamespace
Signed-off-by: Shijiang Wei <mountkin@gmail.com>
2015-09-09 23:21:10 +08:00
David Calavera cc02894a50 Move test specific functions to a testutils package.
This way we won't vendor test related functions in docker anymore.
It also moves netns related functions to a new ns package to be able to
call the ns init function in tests. I think this also helps with the
overall package isolation.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-09-07 13:33:28 -04:00
David Calavera d216db6ef2 Do not print the word `nil` in a log.
Because it doesn't mean anything.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-09-02 08:48:45 -07:00
Jana Radhakrishnan bcd996f4c3 Explicitly set namespace for all network operations
Make sure to always explicitly set namespace for all
kernel bound network operations irrespective of whether
the operation is performed in init namespace or a user
defined namespace. This already happens for user defined
netns. But doesn't happen for initial netns that libnetwork
runs in.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-09-01 14:00:58 -07:00
Alessandro Boch fd43ee1323 Introduce Sandbox entity
- Maps 1 to 1 with container's networking stack
- It holds container's specific nw options which
  before were incorrectly owned by Endpoint.
- Sandbox creation no longer coupled with Endpoint Join,
  sandbox and endpoint have now separate lifecycle.
- LeaveAll naturally replaced by Sandbox.Delete
- some pkg and file renaming in order to have clear
  mapping between structure name and entity ("sandbox")
- Revisited hosts and resolv.conf handling
- Removed from JoinInfo interface capability of setting hosts and resolv.conf paths
- Changed etchosts.Build() to first write the search domains and then the nameservers

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-08-27 11:19:02 -07:00