| Summary: | inetd should add IPV6_V6ONLY option to IPv6 socket | ||
|---|---|---|---|
| Product: | Busybox | Reporter: | AFu Lai <lai.chunfu> |
| Component: | Networking | Assignee: | unassigned |
| Status: | RESOLVED WONTFIX | ||
| Severity: | minor | CC: | busybox-cvs |
| Priority: | P5 | Keywords: | patch |
| Version: | 1.16.x | ||
| Target Milestone: | --- | ||
| Hardware: | Other | ||
| OS: | Linux | ||
| Host: | Target: | ||
| Build: | |||
There is a workaround which might be enough. If you bind to a local address, then depending on address family you are getting bound to IPv6 only or IPv4 only: # nc -vvv -l -s ::1 -p123 listening on [::1]:123 ... Above: I created an IPv6 listening socket on loopback. Now, in another xterm: # nc -vvv -l -s 127.0.0.1 -p123 listening on 127.0.0.1:123 ... I can create an IPv4 listening socket on loopback on the same port, and they happily coexist. If I omit "-s ::1", then second nc complains: "nc: bind: Address already in use" The same idea works for inetd. You need to use address prefix syntax on conf file: ::1:123 stream tcp6 nowait root echo echo Hello IPv6 localhost Closing it as "wontfix" under assumption the described workaround works for you. If you still need this, please reopen. |
I can't open IPv4 and IPv6 listens at the same time due to the fault of 'bind' function. Does anyone want to use IPv4 mapped address? Can we set IPV6_V6ONLY option to IPv6 socket with some conditions? In my case, IPV6_V6ONLY is normally set. ---- #if ENABLE_FEATURE_IPV6 if (sep->se_family == AF_INET6) { // AFU patched int v6only = 1; setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, &v6only, sizeof(v6only)); } #endif r = bind(fd, &sep->se_lsa->u.sa, sep->se_lsa->len);