| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
|
|
|
| |
A range is specified with a dash. For each port in a range a separate listen
socket is created.
Examples:
listen 8080-9000;
listen example.com:80-88;
|
|
|
|
|
|
|
|
|
|
| |
Previously the ngx_inet_resolve_host() function sorted addresses in a way that
IPv4 addresses came before IPv6 addresses. This was implemented in eaf95350d75c
(1.3.10) along with the introduction of getaddrinfo() which could resolve host
names to IPv6 addresses. Since the "listen" directive only used the first
address, sorting allowed to preserve "listen" compatibility with the previous
behavior and with the behavior of nginx built without IPv6 support. Now
"listen" uses all resolved addresses which makes sorting pointless.
|
|
|
|
|
|
| |
Previously only one address was used by the listen directive handler even if
host name resolved to multiple addresses. Now a separate listening socket is
created for each address.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
At least FreeBSD, macOS, NetBSD, and OpenBSD can return unix sockets
with non-null-terminated sun_path. Additionally, the address may become
non-null-terminated if it does not fit into the buffer provided and was
truncated (may happen on macOS, NetBSD, and Solaris, which allow unix socket
addresess larger than struct sockaddr_un). As such, ngx_sock_ntop() might
overread the sockaddr provided, as it used "%s" format and thus assumed
null-terminated string.
To fix this, the ngx_strnlen() function was introduced, and it is now used
to calculate correct length of sun_path.
|
|
|
|
|
|
|
|
|
| |
Linux can return AF_UNIX sockaddrs with partially filled sun_path,
resulting in spurious comparison failures and failed binary upgrades.
Added proper checking of the lengths provided.
Reported by Jan Seda,
http://mailman.nginx.org/pipermail/nginx-devel/2016-September/008832.html.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Now, the module extracts optional port which may accompany an
IP address. This custom extension is introduced, among other
things, in order to facilitate logging of original client ports.
Addresses with ports are expected to be in the RFC 3986 format,
that is, with IPv6 addresses in square brackets. E.g.,
"X-Real-IP: [2001:0db8::1]:12345" sets client port ($remote_port)
to 12345.
|
|
|
|
| |
It's properly aligned and can hold any supported sockaddr.
|
|
|
|
| |
No functional changes, since the condition was always true.
|
|
|
|
|
| |
This fixes buffer over-read when no port is specified in cases
similar to 5df5d7d771f6, and catches missing port separator.
|
|
|
|
| |
It is implied for "x" and "X".
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This fixes buffer over-read while using variables in the "proxy_pass",
"fastcgi_pass", "scgi_pass", and "uwsgi_pass" directives, where result
of string evaluation isn't null-terminated.
Found with MemorySanitizer.
Signed-off-by: Piotr Sikora <piotrsikora@google.com>
|
|
|
|
|
|
| |
Overflow detection of the last octet might not work.
Reported by Sergey Polovko.
|
| |
|
|
|
|
|
| |
It's also extended with the "cmp_port" argument to indicate
whether ports should be compared as well, or only addresses.
|
|
|
|
|
|
| |
Some systems (notably NetBSD and OpenBSD) lack AI_ADDRCONFIG support.
Reported by Piotr Sikora.
|
|
|
|
|
|
|
|
| |
This seems to be the case at least under Cygwin, where build was broken
by 05ba5bce31e0 (1.5.3).
Reported by Kevin Worthington,
http://mailman.nginx.org/pipermail/nginx/2013-August/040028.html.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is done by passing AI_ADDRCONFIG to getaddrinfo().
On Linux, setting net.ipv6.conf.all.disable_ipv6 to 1 will now be
respected.
On FreeBSD, AI_ADDRCONFIG filtering is currently implemented by
attempting to create a datagram socket for the corresponding family,
which succeeds even if the system doesn't in fact have any addresses
of that family configured. That is, if the system with IPv6 support
in the kernel doesn't have IPv6 addresses configured, AI_ADDRCONFIG
will filter out IPv6 only inside a jail without IPv6 addresses or
with IPv6 disabled.
|
|
|
|
|
|
| |
On Linux, sockaddr length is required to process unix socket addresses properly
due to unnamed sockets (which don't have sun_path set at all) and abstract
namespace sockets.
|
|
|
|
|
|
|
|
|
| |
Upstreams created by "proxy_pass" with IP address and no port were
broken in 1.3.10, by not initializing port in u->sockaddr.
API change: ngx_parse_url() was modified to always initialize port
(in u->sockaddr and in u->port), even for the u->no_resolve case;
ngx_http_upstream() and ngx_http_upstream_add() were adopted.
|
| |
|
|
|
|
|
|
|
|
|
| |
This includes "debug_connection", upstreams, "proxy_pass", etc.
(ticket #92)
To preserve compatibility, "listen" specified with a domain name
selects the first IPv4 address, if available. If not available,
the first IPv6 address will be used (ticket #186).
|
|
|
|
|
|
| |
The URL parsing code is not expected to initialize port from default port
when in "no_resolve" mode. This got broken in r4671 for the case of IPv6
literals.
|
|
|
|
|
| |
Except for the "listen" directive, "*" specified as a hostname is
no longer treated specially.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
In collaboration with Maxim Dounin.
|
|
|
|
| |
the allowed range.
|
| |
|
| |
|
| |
|
|
|
|
| |
patch by Maxim Dounin
|
|
|
|
| |
patch by Maxim Dounin
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|