View Single Post

   
  #2 (permalink)  
Old 02-21-2008, 09:18 PM
Casper H.S. Dik
 
Posts: n/a
Default Re: service listener for both IPv4 and IPv6

Panduranga Chary <pr.chary@gmail.com> writes:

>How do we make service both listening to ipv4 and ipv6 in unix.


In Solaris, you create a single IPv6 socket and it will accept
both IPv4 and IPv6 traffice destined for that specific port.

>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/services does not distinguish between IPv6 and IPv4 ports; for
all intents and purposes they are the same.


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


No, just:

service stream tcp6 nowait root service_path service

though it is posisble to use both (in which case separate daemons get
started.


Note that when you use the single socket approach all IPv4 connections
will appear as "IPv4 mapped" addresses.

Casper
--
Expressed in this posting are my opinions. They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.
Reply With Quote