Bug 58725 - [patch] add IP_FREEBIND functionality to allow apache httpd to bind to addresses not owned by any interface
Summary: [patch] add IP_FREEBIND functionality to allow apache httpd to bind to addres...
Status: RESOLVED FIXED
Alias: None
Product: APR
Classification: Unclassified
Component: APR (show other bugs)
Version: 1.5.2
Hardware: PC Linux
: P2 enhancement (vote)
Target Milestone: ---
Assignee: Apache Portable Runtime bugs mailinglist
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-12 20:08 UTC by Ashley GC
Modified: 2016-03-03 15:49 UTC (History)
1 user (show)



Attachments
unified diff patch to add APR_FREEBIND (1007 bytes, patch)
2015-12-12 20:08 UTC, Ashley GC
Details | Diff
Improved patch returning APR_ENOTIMPL if IP_FREEBIND not available (1.14 KB, patch)
2016-02-25 12:01 UTC, jkaluza
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ashley GC 2015-12-12 20:08:49 UTC
Created attachment 33342 [details]
unified diff patch to add APR_FREEBIND

I'd like apache httpd to be able to bind to addresses not owned by any interface, and this requires a call to setsockopt with the IP_FREEBIND option.

Attached is a patch (unified diff) for APR which adds a new APR_FREEBIND option and an extra case in apr_socket_opt_set.

For extra explanation, there is this: https://serverfault.com/questions/742206/how-can-apache-be-configured-to-listen-on-a-single-ipv6-address-which-does-not-b
Comment 1 jkaluza 2016-02-25 12:01:04 UTC
Created attachment 33592 [details]
Improved patch returning APR_ENOTIMPL if IP_FREEBIND not available

I'm not sure if we need to touch network_io for win32 or os2 too...

So far os2 would return APR_SUCCESS and do nothing - but it has the same behaviour for APR_INCOMPLETE_READ for example.

Win32 would return APR_EINVAL, but it also does that for APR_INCOMPLETE_READ or others flags which it doesn't handle.
Comment 2 Joe Orton 2016-03-03 12:15:36 UTC
Committed as APR_SO_FREEBIND in r1733451 and later - thanks!
Comment 3 Ashley GC 2016-03-03 15:49:12 UTC
Thanks, all. I'll test it as soon as I can.