1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Vendor libnetwork v0.6.1-rc1

- Fixes #20026. Programming iptables in container use native API.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
(cherry picked from commit 2da61086ea)

From PR #20060
This commit is contained in:
Madhu Venugopal 2016-02-05 18:20:22 -08:00 committed by Tibor Vass
parent e24d5623a5
commit 0fdc67fb6b
4 changed files with 17 additions and 3 deletions

View file

@ -27,7 +27,7 @@ clone git github.com/RackSec/srslog 6eb773f331e46fbba8eecb8e794e635e75fc04de
clone git github.com/imdario/mergo 0.2.1 clone git github.com/imdario/mergo 0.2.1
#get libnetwork packages #get libnetwork packages
clone git github.com/docker/libnetwork v0.6.0-rc7 clone git github.com/docker/libnetwork v0.6.1-rc1
clone git github.com/armon/go-metrics eb0af217e5e9747e41dd5303755356b62d28e3ec clone git github.com/armon/go-metrics eb0af217e5e9747e41dd5303755356b62d28e3ec
clone git github.com/hashicorp/go-msgpack 71c2886f5a673a35f909803f38ece5810165097b clone git github.com/hashicorp/go-msgpack 71c2886f5a673a35f909803f38ece5810165097b
clone git github.com/hashicorp/memberlist 9a1e242e454d2443df330bdd51a436d5a9058fc4 clone git github.com/hashicorp/memberlist 9a1e242e454d2443df330bdd51a436d5a9058fc4

View file

@ -1,5 +1,8 @@
# Changelog # Changelog
## 0.6.1-rc1 (2016-02-05)
- Fixes https://github.com/docker/docker/issues/20026
## 0.6.0-rc7 (2016-02-01) ## 0.6.0-rc7 (2016-02-01)
- Allow inter-network connections via exposed ports - Allow inter-network connections via exposed ports

View file

@ -325,9 +325,11 @@ func Raw(args ...string) ([]byte, error) {
if err == nil || !strings.Contains(err.Error(), "was not provided by any .service files") { if err == nil || !strings.Contains(err.Error(), "was not provided by any .service files") {
return output, err return output, err
} }
} }
return raw(args...)
}
func raw(args ...string) ([]byte, error) {
if err := initCheck(); err != nil { if err := initCheck(); err != nil {
return nil, err return nil, err
} }
@ -362,6 +364,15 @@ func RawCombinedOutput(args ...string) error {
return nil return nil
} }
// RawCombinedOutputNative behave as RawCombinedOutput with the difference it
// will always invoke `iptables` binary
func RawCombinedOutputNative(args ...string) error {
if output, err := raw(args...); err != nil || len(output) != 0 {
return fmt.Errorf("%s (%v)", string(output), err)
}
return nil
}
// ExistChain checks if a chain exists // ExistChain checks if a chain exists
func ExistChain(chain string, table Table) bool { func ExistChain(chain string, table Table) bool {
if _, err := Raw("-t", string(table), "-L", chain); err == nil { if _, err := Raw("-t", string(table), "-L", chain); err == nil {

View file

@ -95,7 +95,7 @@ func (r *resolver) SetupFunc() func() {
} }
for _, rule := range rules { for _, rule := range rules {
r.err = iptables.RawCombinedOutput(rule...) r.err = iptables.RawCombinedOutputNative(rule...)
if r.err != nil { if r.err != nil {
return return
} }