aboutsummaryrefslogtreecommitdiff
path: root/vendor/golang.org/x/sys/unix/syscall_linux.go
diff options
context:
space:
mode:
authorTomSweeneyRedHat <tsweeney@redhat.com>2019-11-13 10:30:08 -0500
committerTomSweeneyRedHat <tsweeney@redhat.com>2019-11-13 10:57:19 -0500
commit6003033adae775f1d725b05231a246a4462ae669 (patch)
treec570c523df92c3c0fb4b704c5c45b0de6603b7d6 /vendor/golang.org/x/sys/unix/syscall_linux.go
parentde32b89eff0928abdef9d85a420b65d8865e737e (diff)
downloadpodman-6003033adae775f1d725b05231a246a4462ae669.tar.gz
podman-6003033adae775f1d725b05231a246a4462ae669.tar.bz2
podman-6003033adae775f1d725b05231a246a4462ae669.zip
Bump to Buildah v1.11.5
Bump to Buildah v1.11.5. Most notably changes to the podman build `--pull` functionality. `--pull=true` and `--pull=false` now work as Docker does, `--pull-never` added to supply the functionality of the old `--pull=false`. Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
Diffstat (limited to 'vendor/golang.org/x/sys/unix/syscall_linux.go')
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_linux.go85
1 files changed, 85 insertions, 0 deletions
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux.go b/vendor/golang.org/x/sys/unix/syscall_linux.go
index fe30b9544..e538bb567 100644
--- a/vendor/golang.org/x/sys/unix/syscall_linux.go
+++ b/vendor/golang.org/x/sys/unix/syscall_linux.go
@@ -775,6 +775,70 @@ func (sa *SockaddrPPPoE) sockaddr() (unsafe.Pointer, _Socklen, error) {
return unsafe.Pointer(&sa.raw), SizeofSockaddrPPPoX, nil
}
+// SockaddrTIPC implements the Sockaddr interface for AF_TIPC type sockets.
+// For more information on TIPC, see: http://tipc.sourceforge.net/.
+type SockaddrTIPC struct {
+ // Scope is the publication scopes when binding service/service range.
+ // Should be set to TIPC_CLUSTER_SCOPE or TIPC_NODE_SCOPE.
+ Scope int
+
+ // Addr is the type of address used to manipulate a socket. Addr must be
+ // one of:
+ // - *TIPCSocketAddr: "id" variant in the C addr union
+ // - *TIPCServiceRange: "nameseq" variant in the C addr union
+ // - *TIPCServiceName: "name" variant in the C addr union
+ //
+ // If nil, EINVAL will be returned when the structure is used.
+ Addr TIPCAddr
+
+ raw RawSockaddrTIPC
+}
+
+// TIPCAddr is implemented by types that can be used as an address for
+// SockaddrTIPC. It is only implemented by *TIPCSocketAddr, *TIPCServiceRange,
+// and *TIPCServiceName.
+type TIPCAddr interface {
+ tipcAddrtype() uint8
+ tipcAddr() [12]byte
+}
+
+func (sa *TIPCSocketAddr) tipcAddr() [12]byte {
+ var out [12]byte
+ copy(out[:], (*(*[unsafe.Sizeof(TIPCSocketAddr{})]byte)(unsafe.Pointer(sa)))[:])
+ return out
+}
+
+func (sa *TIPCSocketAddr) tipcAddrtype() uint8 { return TIPC_SOCKET_ADDR }
+
+func (sa *TIPCServiceRange) tipcAddr() [12]byte {
+ var out [12]byte
+ copy(out[:], (*(*[unsafe.Sizeof(TIPCServiceRange{})]byte)(unsafe.Pointer(sa)))[:])
+ return out
+}
+
+func (sa *TIPCServiceRange) tipcAddrtype() uint8 { return TIPC_SERVICE_RANGE }
+
+func (sa *TIPCServiceName) tipcAddr() [12]byte {
+ var out [12]byte
+ copy(out[:], (*(*[unsafe.Sizeof(TIPCServiceName{})]byte)(unsafe.Pointer(sa)))[:])
+ return out
+}
+
+func (sa *TIPCServiceName) tipcAddrtype() uint8 { return TIPC_SERVICE_ADDR }
+
+func (sa *SockaddrTIPC) sockaddr() (unsafe.Pointer, _Socklen, error) {
+ if sa.Addr == nil {
+ return nil, 0, EINVAL
+ }
+
+ sa.raw.Family = AF_TIPC
+ sa.raw.Scope = int8(sa.Scope)
+ sa.raw.Addrtype = sa.Addr.tipcAddrtype()
+ sa.raw.Addr = sa.Addr.tipcAddr()
+
+ return unsafe.Pointer(&sa.raw), SizeofSockaddrTIPC, nil
+}
+
func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) {
switch rsa.Addr.Family {
case AF_NETLINK:
@@ -901,6 +965,27 @@ func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) {
}
}
return sa, nil
+ case AF_TIPC:
+ pp := (*RawSockaddrTIPC)(unsafe.Pointer(rsa))
+
+ sa := &SockaddrTIPC{
+ Scope: int(pp.Scope),
+ }
+
+ // Determine which union variant is present in pp.Addr by checking
+ // pp.Addrtype.
+ switch pp.Addrtype {
+ case TIPC_SERVICE_RANGE:
+ sa.Addr = (*TIPCServiceRange)(unsafe.Pointer(&pp.Addr))
+ case TIPC_SERVICE_ADDR:
+ sa.Addr = (*TIPCServiceName)(unsafe.Pointer(&pp.Addr))
+ case TIPC_SOCKET_ADDR:
+ sa.Addr = (*TIPCSocketAddr)(unsafe.Pointer(&pp.Addr))
+ default:
+ return nil, EINVAL
+ }
+
+ return sa, nil
}
return nil, EAFNOSUPPORT
}