z/OS Communications Server: IPv6 Network and Application Design Guide
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Socket address structure changes

z/OS Communications Server: IPv6 Network and Application Design Guide
SC27-3663-00

As mentioned in Basic socket API extensions for IPv6, the socket address structure (sockaddr) is larger for IPv6 and has a slightly different format. This structure is passed as input or output on several socket API calls. The type of structure passed must match the address family of the socket being used on the socket API call. As a result, application changes are necessary. Table 1 describes the necessary changes:
Table 1. sockaddr structure changes
Affected Socket API calls Required changes
Bind(), connect(), sendmsg(), sendto() The length and type of sockaddr structure passed must match the address family of the socket being used (structure sockaddr_in or sockaddr_in6).
accept(), recvmsg(), recvfrom(), getpeername(), getsockname() The sockaddr structure passed needs to be sufficiently large for the address family of the socket being used on these APIs. Note that the larger sockaddr_in6 structure can be passed even for AF_INET sockets. However, the application needs to be aware that the format of the sockaddr structure returned depends on the address family of the input socket.
z/OS® UNIX System Services BPX1SRX (Send/Recv CSM buffers using sockets) The length and type of sockaddr structure passed must match the address family of the socket being used (structure sockaddr_in or sockaddr_in6).

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014