https://issues.apache.org/bugzilla/show_bug.cgi?id=44806
--- Comment #7 from D. Stussy <[EMAIL PROTECTED]> 2008-05-30 14:06:10 PST ---
Revision of Specification (for Manual) - based on my last parse routine:
Command: ProxyBindAddress [<hostname/address-literal>:]<port>[+<range>]
Context: server config, virtual host, "<Proxy>" section (including
<ProxyMatch>)
Default: Address: unspecified address (0.0.0.0 for IPv4; "::/128" for IPv6)
Port: unspecified port (0 => use any port available - OS choice)
Range: 0 (use only the port specified, if any)
Status: Extension
Specifying a hostname or an address-literal shall bind all outbound proxy
requests to the IP address(es) specified or resolved. DNS resolution is
attempted at the time the proxy request is made, so if a hostname maps to
multiple addresses, the address used may vary across requests. If DNS
resolution fails, the proxy request will fail. As noted elsewhere, since IPv6
address literals contain colons, they must appear in brackets.
Specifying a non-zero port locks in that port as the one used, or if a range is
specified, the first one used. Specifying an optional range indicates how many
consecutive port numbers beyond the first may be used. Specifying a range of
"+0" means that only the specified port is used.
Examples:
ProxyBindAddress 192.0.2.1:10000+10
This sets the IP address to the IPv4 address of 192.0.2.1
There are 11 valid ports for this range: 10000-10010
ProxyBindAddress [2001:df8::1]:49151+9
This sets the IP address to the IPv6 address of 2001:df8::1
There are 11 valid ports for this range: 49151-49160
Notes:
In the current implementation, it is not possible to specify separate port
ranges for different addresses or address families. It is also considered an
error to specify an interface with an IPv6 address ("%" parameter). Specifying
port 0 with a range is invalid. Specifying an address literal also locks the
proxy server into the address family the literal belongs to. Therefore, only a
hostname produces an address family independent assignment assuming that both
DNS A and AAAA records exist for the name.
-------------------------------------------------------------
Errata to parsing routine:
1) Boundary condition - Check value - promote ">" to ">=":
+ if ((x < 1) || (x >= 65534)) ...
Specifying port "1+65534" in effect specifies all ports. One should specify
port 0 instead.
2) Boundary condition - Value wraparound.
Add code to check for port range wraparound as only 0-65535 is valid:
+ if ((port + x) > 65535)
+ return "ProxyBindAddress: Invalid port+range - port-wraparound to 0";
insert before "if (scope_id)".
To Rahul: You seem to have an off-by-one issue with the range in your parsing
routine. In your latest version (noon today), you also seem to
"psf->bindopt_set = 1" and overwrite some other variables before all your error
checking is done. I think you'll find my parser (with errors above corrected)
is cleaner.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]