Bug 45321 - Handling IPV6_V6ONLY on NT 5.x
Summary: Handling IPV6_V6ONLY on NT 5.x
Status: CLOSED FIXED
Alias: None
Product: APR
Classification: Unclassified
Component: APR (show other bugs)
Version: HEAD
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache Portable Runtime bugs mailinglist
URL:
Keywords: PatchAvailable
Depends on:
Blocks:
 
Reported: 2008-07-01 16:40 UTC by Sob
Modified: 2014-01-21 13:11 UTC (History)
1 user (show)



Attachments
Proposed patch (1.93 KB, patch)
2008-07-01 16:40 UTC, Sob
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sob 2008-07-01 16:40:59 UTC
Created attachment 22204 [details]
Proposed patch

This is httpd's bug in the first place. But the best place to fix it is apr, so it's why it's here.

Problem:

IPV6_V6ONLY option (for IPv4 mapped addresses) is not in Windows before Vista. If an application running on older Windows calls apr_socket_opt_get() with this option, it gets that the option is not set (previous call to apr_socket_opt_set() fails with OS error or APR_ENOTIMPL depending on SDK version used to compile it). Option not set means that IPv6 socket can accept both IPv6 and IPv4 connections. But it's not possible there, because separate IPv4/6 stacks don't allow mapped addresses.
In this case, if httpd is requested to listen on both 0.0.0.0 and ::, it discards 0.0.0.0, because it thinks that :: will handle it all, but it's wrong.

Solution:

a) every application could manually check current OS version and behave accordingly

b) apr could emulate the option for older Windows to allow writing easily portable code; it's what attached patch does
Comment 1 Jeff Trawick 2011-04-13 08:01:51 UTC
committed to trunk as r1091757

I plan to commit to 1.5.x and 1.4.x prior to the apr 1.4.3 release unless someone complains soon.
Comment 2 Jeff Trawick 2011-04-13 11:40:37 UTC
now in 1.5.x and 1.4.x
thanks!