Re: service listener for both IPv4 and IPv6



Panduranga Chary <pr.chary@xxxxxxxxx> wrote:
How do we make service both listening to ipv4 and ipv6 in unix.


Do we need to create two sockets (1 for v4 and 1 for v6) and listen on
both as in windows XP.

The man page for socket lists separate protocol families for each, so I
think that yes, you need a socket for each:

int f1, f2;
f1 = socket(PF_INET, SOCK_STREAM, 0); /* create the socket */
f2 = socket(PF_INET6, SOCK_STREAM, 0); /* create the socket */
...


For inted initiated service.

we are putting 2 entries (1 for v4 and 1 for v6) though the binary is
same. only single socket opened and address binds to first accepted
address from a call to getaddrinfo().


/etc/services


tcp service #v4
tcp6 service


/etc/inetd.conf
service stream tcp nowait root service_path service
service stream tcp6 nowait root service_path service


Did you run inetconv after making changes to /etc/inetd.conf?
inetd.conf is no longer directly used by Solaris. If you update the
inetd.conf file then you will need to use inetconv(1M) to import the new
records into the smf repository.

--
Dr Tristram J. Scott
Energy Consultant
.