- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Bind ipv6 socket fails on 8.3
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-20-2014 01:56 PM
тАО02-20-2014 01:56 PM
Bind ipv6 socket fails on 8.3
I cannot bind an ipv6 socket on 8.3 using tcpip 5.6. I know that the sockaddr_in6 structure is correct because the same code works on OVMS 7.3 AXP, Windows and *nix. I keep getting EINVAL. I dumped the contents of the sockaddr_in6 structure before the bind call and it is identical to the one on AXP. The length is the same. But the bind() always fails. The sample in the HP TCPIP manual fails in the same way. Is there an ECO that I need to apply? Do I have to upgrade to 8.4? BTW ipv4 sockets work perfectly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-21-2014 12:04 AM
тАО02-21-2014 12:04 AM
Re: Bind ipv6 socket fails on 8.3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-21-2014 02:11 AM
тАО02-21-2014 02:11 AM
Re: Bind ipv6 socket fails on 8.3
Mate, for goodness sake post some code or expect the echoes of a vacant house to whisper in your ears.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-21-2014 10:35 AM
тАО02-21-2014 10:35 AM
Re: Bind ipv6 socket fails on 8.3
HP TCP/IP Services for OpenVMS Industry Standard 64 Version V5.6
on an HP rx2600 (1.50GHz/6.0MB) running OpenVMS 8.3
I have the latest OVMS 8.3 Patch Bundle V18 installed.
From the
HP TCP/IP Services for OpenVMS
Sockets API and System Services Programming Guide, Appendix E.6:
************************************
#include <in.h> /* define internet related constants,
/* functions, and structures */
#include <inet.h> /* define network address info */
#include <netdb.h> /* define network database library info */
#include <socket.h> /* define BSD 4.x socket api */
#include <stdio.h> /* define standard i/o functions */
#include <stdlib.h> /* define standard library functions */
#include <string.h> /* define string handling functions */
#include <unixio.h> /* define unix i/o */
#define SERV_BACKLOG 1 /* server backlog */
#define SERV_PORTNUM 12345 /* server port number */
int main( void ); /* server main */
int
main( void )
{
int optval = 1; /* SO_REUSEADDR'S option value (on) */
int conn_sockfd; /* connection socket descriptor */
int listen_sockfd; /* listen socket descriptor */
int gni_error; /* return status for getnameinfo() */
unsigned int client_addrlen; /* returned length of client socket */
/* address structure */
struct sockaddr_in6 client_addr; /* client socket address structure */
struct sockaddr_in6 serv_addr; /* server socket address structure */
char buf[] = "Hello, world!"; /* server data buffer */
char node[NI_MAXHOST]; /* buffer to receive node name */
char port[NI_MAXHOST]; /* buffer to receive port number */
char addrbuf[INET6_ADDRSTRLEN]; /* buffer to receive host's address */
memset( &client_addr, 0, sizeof(client_addr) );
memset( &serv_addr, 0, sizeof(serv_addr) );
serv_addr.sin6_family = AF_INET6;
serv_addr.sin6_port = htons( SERV_PORTNUM );
serv_addr.sin6_addr = in6addr_any;
if ( (listen_sockfd = socket(AF_INET6, SOCK_STREAM, 0)) < 0 )
{
perror( "Failed to create socket" );
exit( EXIT_FAILURE );
}
if ( setsockopt(listen_sockfd,
SOL_SOCKET, SO_REUSEADDR, &optval, sizeof(optval)) < 0 )
{
perror( "Failed to set socket option" );
exit( EXIT_FAILURE );
}
if ( bind(listen_sockfd,
(struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0 )
{
perror( "Failed to bind socket" );
exit( EXIT_FAILURE );
}
if ( listen(listen_sockfd, SERV_BACKLOG) < 0 )
{
perror( "Failed to set socket passive" );
exit( EXIT_FAILURE );
}
printf( "Waiting for a client connection on port: %d\n",
ntohs(serv_addr.sin6_port)
);
client_addrlen = sizeof(client_addr);
conn_sockfd = accept( listen_sockfd,
(struct sockaddr *) &client_addr,
&client_addrlen
);
if ( conn_sockfd < 0 )
{
perror( "Failed to accept client connection" );
exit( EXIT_FAILURE );
}
gni_error = getnameinfo( (struct sockaddr *)&client_addr,client_addrlen,
node, sizeof(node), NULL, 0, NI_NAMEREQD
);
if ( gni_error )
{
printf( "Failed to translate client address: %s\n",
gai_strerror(gni_error)
);
exit( EXIT_FAILURE );
}
gni_error = getnameinfo( (struct sockaddr *)&client_addr, client_addrlen,
addrbuf, sizeof(addrbuf), port, sizeof(port),
NI_NUMERICHOST | NI_NUMERICSERV
);
if ( gni_error )
{
printf( "Failed to translate client address and/or port: %s\n",
gai_strerror(gni_error)
);
exit( EXIT_FAILURE );
}
printf( "Accepted connection from host: %s (%s), port: %s\n",
node, addrbuf, port
);
if ( send(conn_sockfd, buf, sizeof(buf), 0) < 0 )
{
perror( "Failed to write data to client connection" );
exit( EXIT_FAILURE );
}
printf( "Data sent: %s\n", buf ); /* output server's data buffer */
if ( shutdown(conn_sockfd, 2) < 0 )
{
perror( "Failed to shutdown client connection" );
exit( EXIT_FAILURE );
}
if ( close(conn_sockfd) < 0 )
{
perror( "Failed to close socket" );
exit( EXIT_FAILURE );
}
if ( close(listen_sockfd) < 0 )
{
perror( "Failed to close socket" );
exit( EXIT_FAILURE );
}
exit( EXIT_SUCCESS );
}
************************
It fails at the bind() call. I am wondering if there is something that I need to turn on in TCPIP for IPV6 but I never did anything like that on our 7.3 AXP. I did run the TCPIP$IP6_SETUP script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-21-2014 05:19 PM
тАО02-21-2014 05:19 PM
Re: Bind ipv6 socket fails on 8.3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-21-2014 05:47 PM
тАО02-21-2014 05:47 PM
Re: Bind ipv6 socket fails on 8.3
The original submission says bind() fails with EINVAL. I looked for TCPIP ECOs but did not find any. You are running 8.3-1H1, I am running 8.3, hence the difference in (cut and pasted) version strings.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-21-2014 08:57 PM
тАО02-21-2014 08:57 PM
Re: Bind ipv6 socket fails on 8.3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-21-2014 09:51 PM
тАО02-21-2014 09:51 PM
Re: Bind ipv6 socket fails on 8.3
TCPIP ECO5 does not help, still fails. Take the sample code, compile,link and run it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-26-2014 06:05 PM
тАО02-26-2014 06:05 PM
Re: Bind ipv6 socket fails on 8.3
Call me thick, but I don't see in the code where errno is used? Are you compiling something not the same as this code?
Also, perhaps you could show the ACTUAL output of the executable.
It may be failing, but this code you posted gives NO indication as to what error is being issued, other than the generic trap to check bind() returns -1.
On the off chance, that socket's not being used?
Do a netstat of the system just to eliminate this possibility.
You may need to run @sys$manager:tcpip$define_commands before hand.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-26-2014 06:46 PM
тАО02-26-2014 06:46 PM
Re: Bind ipv6 socket fails on 8.3
The
perror( "Failed to bind socket" );
returns the message:
Failed to bind socket: invalid argument
Invalid argument means EINVAL. Output is
TRI21>cc/decc qq
TRI21>link qq,tcpip$library:tcpip$lib/lib
TRI21>run qq
Failed to bind socket: invalid argument
TRI21>
nestat shows
Active Internet connections
Proto Recv-Q Send-Q Local Address Foreign Address (state)
tcp 0 0 tri21.49152 RAD.2049 ESTABLI
SHED
tcp 0 0 tri21.23 RAD.53979 ESTABLI
SHED
tcp 0 0 *.611 *.* LISTEN
udp 0 0 fe80::230:6eff:fe39:575b.123 *.*
udp 0 0 tri21.123 *.*
udp 0 0 localhost.123 *.*
udp 0 0 LOCALHOST.123 *.*
udp 0 0 *.123 *.*