Differential D21570 Diff 79325 sysutils/docker-freebsd/files/patch-vendor_github.com_docker_libnetwork_portmapper_proxy__freebsd.go
Changeset View
Changeset View
Standalone View
Standalone View
sysutils/docker-freebsd/files/patch-vendor_github.com_docker_libnetwork_portmapper_proxy__freebsd.go
- This file was added.
Property | Old Value | New Value |
---|---|---|
fbsd:nokeywords | null | yes \ No newline at end of property |
svn:eol-style | null | native \ No newline at end of property |
svn:mime-type | null | text/plain \ No newline at end of property |
--- vendor/github.com/docker/libnetwork/portmapper/proxy_freebsd.go.orig 2019-06-24 18:17:46 UTC | |||||
+++ vendor/github.com/docker/libnetwork/portmapper/proxy_freebsd.go | |||||
@@ -0,0 +1,38 @@ | |||||
+package portmapper | |||||
+ | |||||
+import ( | |||||
+ "net" | |||||
+ "os/exec" | |||||
+ "strconv" | |||||
+ "syscall" | |||||
+) | |||||
+ | |||||
+func newProxyCommand(proto string, hostIP net.IP, hostPort int, containerIP net.IP, containerPort int, proxyPath string) (userlandProxy, error) { | |||||
+ path := proxyPath | |||||
+ if proxyPath == "" { | |||||
+ cmd, err := exec.LookPath(userlandProxyCommandName) | |||||
+ if err != nil { | |||||
+ return nil, err | |||||
+ } | |||||
+ path = cmd | |||||
+ } | |||||
+ | |||||
+ args := []string{ | |||||
+ path, | |||||
+ "-proto", proto, | |||||
+ "-host-ip", hostIP.String(), | |||||
+ "-host-port", strconv.Itoa(hostPort), | |||||
+ "-container-ip", containerIP.String(), | |||||
+ "-container-port", strconv.Itoa(containerPort), | |||||
+ } | |||||
+ | |||||
+ return &proxyCommand{ | |||||
+ cmd: &exec.Cmd{ | |||||
+ Path: path, | |||||
+ Args: args, | |||||
+ SysProcAttr: &syscall.SysProcAttr{ | |||||
+ Pdeathsig: syscall.SIGTERM, // send a sigterm to the proxy if the daemon process dies | |||||
+ }, | |||||
+ }, | |||||
+ }, nil | |||||
+} |