vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi, 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. or 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 Could you please suggest. How we go about it. Thanks Panduranga Chary |
| |||
| 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. |
| |||
| Panduranga Chary <pr.chary@gmail.com> 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 |
| ||||
| Casper H.S. Dik <Casper.Dik@Sun.COM> writes: > 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. Although this is true, I would not recommend designing an application to work this way. Instead, opening separate sockets for v4 and v6 (using the IPV6_V6ONLY option for the latter) is the recommended way to go. See the notes in PSARC 2006/466; we had a lengthy discussion with Erik Nordmark about this, and the bottom line is that the transition mechanisms don't work particularly well for anything other than the most trivial of applications. -- James Carlson, Solaris Networking <james.d.carlson@sun.com> Sun Microsystems / 35 Network Drive 71.232W Vox +1 781 442 2084 MS UBUR02-212 / Burlington MA 01803-2757 42.496N Fax +1 781 442 1677 |