Commit Graph

26 Commits

Author SHA1 Message Date
1c9316a817 Merge pull request #11788 from reikani/pchoi
Changed snake case naming to camelCase.
Upstream-commit: da5c863d20df8c030b3ffc6c4e95f976ed162721
Component: engine
2015-03-26 23:55:50 -07:00
e5b36a723c Replace aliased imports of logrus, fixes #11762
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: 6f4d847046cb4e072de61d042c0266190d73a8c9
Component: engine
2015-03-26 23:22:04 +01:00
0913f2905d Changed snake case naming to camelCase
Signed-off-by: Peter Choi <phkchoi89@gmail.com>
Upstream-commit: ae907e7af16136225417242ef5d55d3f6062fb3b
Component: engine
2015-03-26 15:05:45 -06:00
2781401caa fix various problems with iptables.Exists
This modifies iptables.Exists so that it must be called with an explicit
table and chain.  This allows us (a) to generate an appropriate command
line for "iptables -C", which was not previously possible, and (b) it
allows us to limit our strings.Contains() search to just the table and
chain in question, preventing erroneous matches against unrelated rules.

Resolves #10781

Signed-off-by: Lars Kellogg-Stedman <lars@redhat.com>
Upstream-commit: 3559b4177e611920d87c4dae607c641efb645783
Component: engine
2015-03-16 17:14:45 -04:00
5506a9a27c Remove subdirectories MAINTAINERS files
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
Upstream-commit: 89bdaa35e04b74b7c6528783e0f7b8154b2a3d31
Component: engine
2015-03-06 18:21:51 -08:00
42697702c5 Move iptables check out of runtime init() to separate function
Due to the iptables package being `init`ed at start of the docker
runtime, this means the iptables --wait command listing all rules
is run, no matter if the command is simply "docker -h".  It makes
more sense to both locate the iptables command and check for the
wait flag support at the time iptables is actually used, as it
may not be used at all if certain network support is off/configured
differently.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
Upstream-commit: 5e8285b08120f674b12a34c3f146216f6854a173
Component: engine
2015-01-20 21:04:22 -05:00
4b105a7583 Create tests for pkg/iptables
Docker-DCO-1.1-Signed-off-by: Ian Bishop <ianbishop@pace7.com> (github: porjo)
Upstream-commit: 0da92633b4161ed1f8babe5ec4a9fe98257d34b5
Component: engine
2014-12-21 12:57:32 +10:00
ae55b92633 Create DOCKER forward chain on driver init
Docker-DCO-1.1-Signed-off-by: Ian Bishop <ianbishop@pace7.com> (github: porjo)
Upstream-commit: 2865373894f1532fa725481e8f04db4a5d7a0aa8
Component: engine
2014-12-21 12:57:32 +10:00
c720d69487 Move per-container forward rules to DOCKER chain
Docker-DCO-1.1-Signed-off-by: Ian Bishop <ianbishop@pace7.com> (github: porjo)
Upstream-commit: cc89b30d35edc02fc598a0b26fe7a1ed002238e4
Component: engine
2014-12-21 12:57:32 +10:00
cbc7790607 Typed errors for iptables chain raw command output. YAYYYYYY.
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
Upstream-commit: 6cc75574b3b01fa4dfeeef585e52dbcf8da28586
Component: engine
2014-11-20 18:07:11 -08:00
0f9991ec4d Revert "Support hairpin NAT"
This reverts commit 95a400e6e1a3b5da68431e64f9902a3fac218360.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: 56c37536315d4c63c35b766e3335034e488e2189
Component: engine
2014-11-20 14:22:32 -08:00
5fd84c98fc Support hairpin NAT
This re-applies commit b39d02b with additional iptables rules to solve the issue with containers routing back into themselves.

The previous issue with this attempt was that the DNAT rule would send traffic back into the container it came from. When this happens you have 2 issues.
1) reverse path filtering. The container is going to see the traffic coming in from the outside and it's going to have a source address of itself. So reverse path filtering will kick in and drop the packet.
2) direct return mismatch. Assuming you turned reverse path filtering off, when the packet comes back in, it's goign to have a source address of itself, thus when the reply traffic is sent, it's going to have a source address of itself. But the original packet was sent to the host IP address, so the traffic will be dropped because it's coming from an address which the original traffic was not sent to (and likely with an incorrect port as well).

The solution to this is to masquerade the traffic when it gets routed back into the origin container. However for this to work you need to enable hairpin mode on the bridge port, otherwise the kernel will just drop the traffic.
The hairpin mode set is part of libcontainer, while the MASQ change is part of docker.

This reverts commit 63c303eecdbaf4dc7967fd51b82cd447c778cecc.

Docker-DCO-1.1-Signed-off-by: Patrick Hemmer <patrick.hemmer@gmail.com> (github: phemmer)
Upstream-commit: 95a400e6e1a3b5da68431e64f9902a3fac218360
Component: engine
2014-11-03 23:09:08 -05:00
54a35eb340 Merge pull request #8198 from jfrazelle/add-jessie-to-various-maintainers
Adding self to various maintainers files.
Upstream-commit: f0327c99dd6fb7353d76726e0adb67a1b5a98451
Component: engine
2014-10-28 19:35:28 -07:00
2d56e3cbc6 Use logrus everywhere for logging
Fixed #8761

Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
Upstream-commit: 7c62cee51edc91634046b4faa6c6f1841cd53ec1
Component: engine
2014-10-24 15:03:06 -07:00
8734c910c3 Adding self to various maintainers files.
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
Upstream-commit: 6c60e8c7849742c111a2b0a5ad4ff88fc8e960ef
Component: engine
2014-09-29 15:43:07 -07:00
50457aefd5 daemon logging: unifying output and timestamps
A little refactor of the ./pkg/log so engine can have a logger instance

Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: 92df943fbf225d78b160babb36e9c6fd38cdc0d0
Component: engine
2014-09-26 14:44:46 -04:00
4e7b27c469 Fix duplicate iptables rules
If iptables version is < 1.4.11, try to delete the rule vs. checking if it exists. Fixes #6831.

Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jfrazelle@users.noreply.github.com> (github: jfrazelle)
Upstream-commit: f3a68ffa390fb851115c77783fa4031f1d3b2995
Component: engine
2014-09-07 15:12:19 -07:00
54c61632f8 use stderr to debug iptables
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Upstream-commit: 5708aa62f36eadca5ada235ca05fddeb1510c1c6
Component: engine
2014-05-30 19:39:42 +00:00
ee4e3699c5 * do not consider iptables' output an error in case of xtables lock
Docker-DCO-1.1-Signed-off-by: Giuseppe Mazzotta <gdm85@users.noreply.github.com> (github: gdm85)
Upstream-commit: 5e3b643ce6f43d02fc7fe88eba41d583044a2efd
Component: engine
2014-05-29 15:57:29 +02:00
b33af77b2c Add check for iptables xlock support
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 034babf1753741184c1155a7346ecec86fc51e2c
Component: engine
2014-05-23 14:18:50 -07:00
d002ab21b5 Add wait flag to iptables
Fixes #1573
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: b315c380f4acd65cc0428009702f99a266f96c59
Component: engine
2014-05-23 01:24:58 +00:00
6caf919b33 Revert "Support hairpin NAT without going through docker server"
This reverts commit b39d02b611f1cc0af283f417b73bf0d36f26277a.

Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 63c303eecdbaf4dc7967fd51b82cd447c778cecc
Component: engine
2014-04-09 11:55:08 +00:00
410076baa7 Support hairpin NAT without going through docker server
Hairpin NAT is currently done by passing through the docker server.  If
two containers on the same box try to access each other through exposed
ports and using the host IP the current iptables rules will not match the
DNAT and thus the traffic goes to 'docker -d'

This change drops the restriction that DNAT traffic must not originate
from docker0.  It should be safe to drop this restriction because the
DOCKER chain is already gated by jumps that check for the destination
address to be a local address.

Docker-DCO-1.1-Signed-off-by: Darren Shepherd <darren.s.shepherd@gmail.com> (github: ibuildthecloud)
Upstream-commit: b39d02b611f1cc0af283f417b73bf0d36f26277a
Component: engine
2014-03-03 21:53:57 -07:00
126d36548e iptables: use dest_addr and dest_port for public port FORWARD rule
Docker-DCO-1.1-Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com> (github: jpoimboe)
Upstream-commit: ea63ade772445591e78b42a36fa0dcfffa4a9f1a
Component: engine
2014-02-04 11:32:50 -06:00
261cb491a3 network: add publicly mapped ports to FORWARD table
Allow publicly mapped ports to be made public beyond the host.  This is
needed for distros like Fedora and RHEL which have a reject all rule at
the end of their FORWARD table.

Docker-DCO-1.1-Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com> (github: jpoimboe)
Upstream-commit: db250f709ad5bcee313710d34e0b6ef02abdc326
Component: engine
2014-01-28 13:11:49 -06:00
d5d32a285c Move utility package 'iptables' to pkg/iptables
Upstream-commit: 7799ae27ca1dd85761f0595346a0dda15bbeda6c
Component: engine
2014-01-06 15:41:24 -08:00