Commit b2272ae8 authored by Dmitry Smirnov's avatar Dmitry Smirnov

un-vendor golang-github-ishidawataru-sctp-dev

parent 94263932
......@@ -72,6 +72,7 @@ Build-Depends: debhelper (>= 11~) ,dh-exec ,dh-golang (>= 1.14~)
,golang-github-hashicorp-go-version-dev
,golang-github-hashicorp-memberlist-dev (>= 0.1.0~)
,golang-github-hashicorp-serf-dev
,golang-github-ishidawataru-sctp-dev
,golang-github-imdario-mergo-dev (>= 0.3.3~)
,golang-github-json-iterator-go-dev (>= 1.1.4~)
,golang-github-kr-pty-dev
......
......@@ -111,7 +111,7 @@ Files-Excluded:
vendor/github.com/hashicorp/serf
vendor/github.com/imdario/mergo
vendor/github.com/inconshreveable/mousetrap
~~vendor/github.com/ishidawataru/sctp
vendor/github.com/ishidawataru/sctp
vendor/github.com/jmespath/go-jmespath
vendor/github.com/json-iterator/go
vendor/github.com/kr/pty
......
Origin: upstream, https://github.com/docker/libnetwork/commit/667fe006e84c5cf6cfb24629756369228d6b46f9
From 667fe006e84c5cf6cfb24629756369228d6b46f9 Mon Sep 17 00:00:00 2001
From: Sascha Grunert <sgrunert@suse.com>
Date: Thu, 2 May 2019 13:23:31 +0200
Subject: Update sctp package
This commit updates the vendored ishidawataru/sctp and adapts its used
types.
--- a/libnetwork/cmd/proxy/main.go
+++ b/libnetwork/cmd/proxy/main.go
@@ -50,10 +50,10 @@
case "udp":
host = &net.UDPAddr{IP: net.ParseIP(*hostIP), Port: *hostPort}
container = &net.UDPAddr{IP: net.ParseIP(*containerIP), Port: *containerPort}
case "sctp":
- host = &sctp.SCTPAddr{IP: []net.IP{net.ParseIP(*hostIP)}, Port: *hostPort}
- container = &sctp.SCTPAddr{IP: []net.IP{net.ParseIP(*containerIP)}, Port: *containerPort}
+ host = &sctp.SCTPAddr{IPAddrs: []net.IPAddr{{IP: net.ParseIP(*hostIP)}}, Port: *hostPort}
+ container = &sctp.SCTPAddr{IPAddrs: []net.IPAddr{{IP: net.ParseIP(*containerIP)}}, Port: *containerPort}
default:
log.Fatalf("unsupported protocol %s", *proto)
}
--- a/libnetwork/cmd/proxy/network_proxy_test.go
+++ b/libnetwork/cmd/proxy/network_proxy_test.go
@@ -284,9 +284,9 @@
func TestSCTP4Proxy(t *testing.T) {
backend := NewEchoServer(t, "sctp", "127.0.0.1:0", EchoServerOptions{})
defer backend.Close()
backend.Run()
- frontendAddr := &sctp.SCTPAddr{IP: []net.IP{net.IPv4(127, 0, 0, 1)}, Port: 0}
+ frontendAddr := &sctp.SCTPAddr{IPAddrs: []net.IPAddr{{IP: net.IPv4(127, 0, 0, 1)}}, Port: 0}
proxy, err := NewProxy(frontendAddr, backend.LocalAddr())
if err != nil {
t.Fatal(err)
}
@@ -297,9 +297,9 @@
t.Skip("Need to start CI docker with --ipv6")
backend := NewEchoServer(t, "sctp", "[::1]:0", EchoServerOptions{})
defer backend.Close()
backend.Run()
- frontendAddr := &sctp.SCTPAddr{IP: []net.IP{net.IPv6loopback}, Port: 0}
+ frontendAddr := &sctp.SCTPAddr{IPAddrs: []net.IPAddr{{IP: net.IPv6loopback}}, Port: 0}
proxy, err := NewProxy(frontendAddr, backend.LocalAddr())
if err != nil {
t.Fatal(err)
}
--- a/libnetwork/portmapper/mapper.go
+++ b/libnetwork/portmapper/mapper.go
@@ -136,18 +136,18 @@
}
m = &mapping{
proto: proto,
- host: &sctp.SCTPAddr{IP: []net.IP{hostIP}, Port: allocatedHostPort},
+ host: &sctp.SCTPAddr{IPAddrs: []net.IPAddr{{IP: hostIP}}, Port: allocatedHostPort},
container: container,
}
if useProxy {
sctpAddr := container.(*sctp.SCTPAddr)
- if len(sctpAddr.IP) == 0 {
+ if len(sctpAddr.IPAddrs) == 0 {
return nil, ErrSCTPAddrNoIP
}
- m.userlandProxy, err = newProxy(proto, hostIP, allocatedHostPort, sctpAddr.IP[0], sctpAddr.Port, pm.proxyPath)
+ m.userlandProxy, err = newProxy(proto, hostIP, allocatedHostPort, sctpAddr.IPAddrs[0].IP, sctpAddr.Port, pm.proxyPath)
if err != nil {
return nil, err
}
} else {
@@ -231,12 +231,12 @@
return pm.Allocator.ReleasePort(a.IP, "tcp", a.Port)
case *net.UDPAddr:
return pm.Allocator.ReleasePort(a.IP, "udp", a.Port)
case *sctp.SCTPAddr:
- if len(a.IP) == 0 {
+ if len(a.IPAddrs) == 0 {
return ErrSCTPAddrNoIP
}
- return pm.Allocator.ReleasePort(a.IP[0], "sctp", a.Port)
+ return pm.Allocator.ReleasePort(a.IPAddrs[0].IP, "sctp", a.Port)
}
return ErrUnknownBackendAddressType
}
@@ -260,13 +260,13 @@
return fmt.Sprintf("%s:%d/%s", t.IP.String(), t.Port, "tcp")
case *net.UDPAddr:
return fmt.Sprintf("%s:%d/%s", t.IP.String(), t.Port, "udp")
case *sctp.SCTPAddr:
- if len(t.IP) == 0 {
+ if len(t.IPAddrs) == 0 {
logrus.Error(ErrSCTPAddrNoIP)
return ""
}
- return fmt.Sprintf("%s:%d/%s", t.IP[0].String(), t.Port, "sctp")
+ return fmt.Sprintf("%s:%d/%s", t.IPAddrs[0].IP.String(), t.Port, "sctp")
}
return ""
}
@@ -276,13 +276,13 @@
return t.IP, t.Port
case *net.UDPAddr:
return t.IP, t.Port
case *sctp.SCTPAddr:
- if len(t.IP) == 0 {
+ if len(t.IPAddrs) == 0 {
logrus.Error(ErrSCTPAddrNoIP)
return nil, 0
}
- return t.IP[0], t.Port
+ return t.IPAddrs[0].IP, t.Port
}
return nil, 0
}
--- a/libnetwork/portmapper/proxy.go
+++ b/libnetwork/portmapper/proxy.go
@@ -89,9 +89,9 @@
case "udp":
addr := &net.UDPAddr{IP: hostIP, Port: hostPort}
return &dummyProxy{addr: addr}, nil
case "sctp":
- addr := &sctp.SCTPAddr{IP: []net.IP{hostIP}, Port: hostPort}
+ addr := &sctp.SCTPAddr{IPAddrs: []net.IPAddr{{IP: hostIP}}, Port: hostPort}
return &dummyProxy{addr: addr}, nil
default:
return nil, fmt.Errorf("Unknown addr type: %s", proto)
}
--- a/libnetwork/types/types.go
+++ b/libnetwork/types/types.go
@@ -98,9 +98,9 @@
return &net.UDPAddr{IP: p.HostIP, Port: int(p.HostPort)}, nil
case TCP:
return &net.TCPAddr{IP: p.HostIP, Port: int(p.HostPort)}, nil
case SCTP:
- return &sctp.SCTPAddr{IP: []net.IP{p.HostIP}, Port: int(p.HostPort)}, nil
+ return &sctp.SCTPAddr{IPAddrs: []net.IPAddr{{IP: p.HostIP}}, Port: int(p.HostPort)}, nil
default:
return nil, ErrInvalidProtocolBinding(p.Proto.String())
}
}
@@ -112,9 +112,9 @@
return &net.UDPAddr{IP: p.IP, Port: int(p.Port)}, nil
case TCP:
return &net.TCPAddr{IP: p.IP, Port: int(p.Port)}, nil
case SCTP:
- return &sctp.SCTPAddr{IP: []net.IP{p.IP}, Port: int(p.Port)}, nil
+ return &sctp.SCTPAddr{IPAddrs: []net.IPAddr{{IP: p.IP}}, Port: int(p.Port)}, nil
default:
return nil, ErrInvalidProtocolBinding(p.Proto.String())
}
}
......@@ -26,6 +26,7 @@ engine-test-noinstall.patch
go-metrics_prometheus-fix_Observer.patch
lib-update-sctp.patch
libnetwork_proto.patch
libnetwork_proto_no_unrecognized_all.patch
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment