diff options
author | Matthew Heon <mheon@redhat.com> | 2019-03-14 16:25:47 -0400 |
---|---|---|
committer | Matthew Heon <matthew.heon@pm.me> | 2019-03-15 10:51:33 -0400 |
commit | 101e6f6b74d4ddda1f3e5a4332ca8b072fb1a872 (patch) | |
tree | 151c5a8758361ee2d3e4bb0dd6214cc60df1bbef /libpod/oci.go | |
parent | 8aed32acea9bb35898abcee58fc9aa2a03ef264a (diff) | |
download | podman-101e6f6b74d4ddda1f3e5a4332ca8b072fb1a872.tar.gz podman-101e6f6b74d4ddda1f3e5a4332ca8b072fb1a872.tar.bz2 podman-101e6f6b74d4ddda1f3e5a4332ca8b072fb1a872.zip |
Add support for SCTP port forwarding
SCTP is already present and enabled in the CNI plugins, so all we
need to do to add support is not error on attempting to bind
ports to reserve them.
I investigated adding this binding for SCTP, but support for SCTP
in Go is honestly a mess - there's no widely-supported library
for doing it that will do what we need.
For now, warn that port reservation for SCTP is not supported and
forward the ports.
Signed-off-by: Matthew Heon <mheon@redhat.com>
Diffstat (limited to 'libpod/oci.go')
-rw-r--r-- | libpod/oci.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libpod/oci.go b/libpod/oci.go index 30360d289..69cff6d3c 100644 --- a/libpod/oci.go +++ b/libpod/oci.go @@ -183,6 +183,7 @@ func waitPidsStop(pids []int, timeout time.Duration) error { func bindPorts(ports []ocicni.PortMapping) ([]*os.File, error) { var files []*os.File + notifySCTP := false for _, i := range ports { switch i.Protocol { case "udp": @@ -218,6 +219,12 @@ func bindPorts(ports []ocicni.PortMapping) ([]*os.File, error) { } files = append(files, f) break + case "sctp": + if !notifySCTP { + notifySCTP = true + logrus.Warnf("port reservation for SCTP is not supported") + } + break default: return nil, fmt.Errorf("unknown protocol %s", i.Protocol) |