Commit Graph

17805 Commits

Author SHA1 Message Date
Willy Tarreau
a1efc048bf [RELEASE] Released version 2.6.0
Released version 2.6.0 with the following main changes :
    - DOC: Fix formatting in configuration.txt to fix dconv
    - CLEANUP: tcpcheck: Remove useless test on the stream-connector in tcpcheck_main
    - CLEANUP: muxes: Consider stream's sd as defined in .show_fd callback functions
    - MINOR: quic: Ignore out of packet padding.
    - CLEANUP: quic: Useless QUIC_CONN_TX_BUF_SZ definition
    - CLEANUP: quic: No more used handshake output buffer
    - MINOR: quic: QUIC transport parameters split.
    - MINOR: quic: Transport parameters dump
    - DOC: quic: Update documentation for QUIC Retry
    - MINOR: quic: Tunable "max_idle_timeout" transport parameter
    - MINOR: quic: Tunable "initial_max_streams_bidi" transport parameter
    - MINOR: quic: Clarifications about transport parameters value
    - MINOIR: quic_stats: add QUIC connection errors counters
    - BUG/MINOR: quic: Largest RX packet numbers mixing
    - MINOR: quic_stats: Add transport new counters (lost, stateless reset, drop)
    - DOC: quic: Documentation update for QUIC
    - MINOR: quic: Connection TX buffer setting renaming.
    - MINOR: h3: Add a statistics module for h3
    - MINOR: quic: Send STOP_SENDING frames if mux is released
    - MINOR: quic: Do not drop packets with RESET_STREAM frames
    - BUG/MINOR: qpack: fix buffer API usage on prefix integer encoding
    - BUG/MINOR: qpack: support bigger prefix-integer encoding
    - BUG/MINOR: h3: do not report bug on unknown method
    - SCRIPTS: add make-releases-json to recreate a releases.json file in download dirs
    - SCRIPTS: make publish-release try to launch make-releases-json
    - MINOR: htx: add an unchecked version of htx_get_head_blk()
    - BUILD: htx: use the unchecked version of htx_get_head_blk() where needed
    - BUILD: quic: use inttypes.h instead of stdint.h
    - DOC: internal: remove totally outdated diagrams
    - DOC: remove the outdated ROADMAP file
    - DOC: add maintainers for QUIC and HTTP/3
    - MINOR: h3: define h3 trace module
    - MINOR: h3: add traces on frame recv
    - MINOR: h3: add traces on frame send
    - MINOR: h3: add traces on h3s init/end
    - EXAMPLES: remove completely outdated acl-content-sw.cfg
    - BUILD: makefile: reorder objects by build time
    - DOC: fix a few spelling mistakes in the docs
    - BUG/MEDIUM: peers/cli: fix "show peers" crash
    - CLEANUP: peers/cli: stop misusing the appctx local variable
    - CLEANUP: peers/cli: make peers_dump_peer() take an appctx instead of an stconn
    - BUG/MINOR: peers: set the proxy's name to the peers section name
    - MINOR: server: indicate when no address was expected for a server
    - BUG/MINOR: peers: detect and warn on init_addr/resolvers/check/agent-check
    - DOC: peers: indicate that some server settings are not usable
    - DOC: peers: clarify when entry expiration date is renewed.
    - DOC: peers: fix port number and addresses on new peers section format
    - DOC: gpc/gpt: add commments of gpc/gpt array definitions on stick tables.
    - DOC: install: update supported OpenSSL versions in the INSTALL doc
    - MINOR: ncbuf: adjust ncb_data with NCBUF_NULL
    - BUG/MINOR: h3: fix frame demuxing
    - BUG/MEDIUM: h3: fix H3_EXCESSIVE_LOAD when receiving H3 frame header only
    - BUG/MINOR: quic: Fix QUIC_EV_CONN_PRSAFRM event traces
    - CLEANUP: quic: remove useless check on local UNI stream reception
    - BUG/MINOR: qpack: do not consider empty enc/dec stream as error
    - DOC: intro: adjust the numbering of paragrams to keep the output ordered
    - MINOR: version: mention that it's LTS now.
2022-05-31 16:58:21 +02:00
Willy Tarreau
b2c1e081f7 MINOR: version: mention that it's LTS now.
The version will be maintained up to around Q2 2027. Let's
also update the INSTALL file to mention this.
2022-05-31 16:53:13 +02:00
Willy Tarreau
e68e7e8426 DOC: intro: adjust the numbering of paragrams to keep the output ordered
The HTML version appeared with sections in a different order where
3.3.10..3.3.16 were placed between 3.3.1 and 3.3.2. This patch just slips
them into an intermediary section so that we now have "basic features",
"standard features", and "advanced features".
2022-05-31 16:24:43 +02:00
Amaury Denoyelle
5869cb669e BUG/MINOR: qpack: do not consider empty enc/dec stream as error
When parsing QPACK encoder/decoder streams, h3_decode_qcs() displays an
error trace if they are empty. Change the return code used in QPACK code
to avoid this trace.

To uniformize with MUX/H3 code, 0 is now used to indicate success.

Beyond this spurious error trace, this bug has no impact.
2022-05-31 15:35:06 +02:00
Amaury Denoyelle
9f17a5aa8a CLEANUP: quic: remove useless check on local UNI stream reception
The MUX now provides a single API for both uni and bidirectional
streams. It is responsible to reject reception on a local unidirectional
stream with the error STREAM_STATE_ERROR. This is already implemented in
qcc_recv(). As such, remove this duplicated check from xprt_quic.c.
2022-05-31 15:21:13 +02:00
Frédéric Lécaille
fdc1b96357 BUG/MINOR: quic: Fix QUIC_EV_CONN_PRSAFRM event traces
This is a quic_frame struct pointer which must be passed as parameter
to TRACE_PROTO() for such an event.
2022-05-31 14:46:02 +02:00
Amaury Denoyelle
417c7c03f4 BUG/MEDIUM: h3: fix H3_EXCESSIVE_LOAD when receiving H3 frame header only
The H3 frame demuxing code is incorrect when receiving a STREAM frame
which contains only a new H3 frame header without its payload.

In this case, the check on frames bigger than the buffer size is
incorrect. This is because the buffer has been freed via
qcs_consume()/qc_free_ncbuf() as it was emptied after H3 frame header
parsing. This causes the connection to be incorrectly closed with
H3_EXCESSIVE_LOAD error.

This bug was reproduced with xquic client on the interop and with the
command-line invocation :

$ ./interop_client -l d -k $SSLKEYLOGFILE -a <addr> -p <port> -D /tmp \
    -A h3 -U https://<addr>:<port>/hello_world.txt

Note also that h3_is_frame_valid() invocation has been moved before the
new buffer size check. This ensures that first we check the frame
validity before returning from the function. It's also better
positionned as this is only needed when a new H3 frame header has been
parsed.
2022-05-31 14:45:51 +02:00
Amaury Denoyelle
88d5dd1a6f BUG/MINOR: h3: fix frame demuxing
The H3 demuxing code was not fully correct. After parsing the H3 frame
header, the check between frame length and buffer data is wrong as we
compare a copy of the buffer made before the H3 header removal.

Fix this by improving the H3 demuxing code API. h3_decode_frm_header()
now uses a ncbuf instance, this prevents an unnecessary cast
ncbuf/buffer in h3_decode_qcs() which resolves this error.

This bug was not triggered at this moment. Its impact should be really
limited.
2022-05-31 14:43:14 +02:00
Amaury Denoyelle
1194db24bc MINOR: ncbuf: adjust ncb_data with NCBUF_NULL
Replace ncb_blk_is_null() by ncb_is_null() as a prelude to ncb_data().
The result is the same : the function will return 0 if the buffer is
uninitialized. However, it is clearer to directly call ncb_is_null() to
reflect this.

There is no functional change with this commit.
2022-05-31 14:31:48 +02:00
Willy Tarreau
cd50e7673f DOC: install: update supported OpenSSL versions in the INSTALL doc
OpenSSL 3.0 is now supported but was not mentioned. Also, it was
found that OpenSSL 0.9.8 doesn't build anymore since 2.5 due to
some of the functions used in the JWT token processing, and since
nobody complained, it seems it's not worth fixing it so support for
it was removed.
2022-05-31 11:45:50 +02:00
Emeric Brun
5e349e7b7e DOC: gpc/gpt: add commments of gpc/gpt array definitions on stick tables.
Some users misunderstood that the parameter of gpc() gpt()
store types on the table line presents the number of elements
of the array to store and not an index of gpt/gpc tag/counter.

This patch adds some explanations.

This patch addresses github issue #1630

It should be backorted in until branch 2.5.
2022-05-31 10:29:36 +02:00
Emeric Brun
e77984f700 DOC: peers: fix port number and addresses on new peers section format
This patch fix the port number and addresses on the example
to match those of the old format.

This patch address the github issue #1492

This patch should be backported until version 2.0
2022-05-31 10:29:36 +02:00
Emeric Brun
423ed389ac DOC: peers: clarify when entry expiration date is renewed.
This patch add some details to know which rules are updating
the expiration timer of an entry.

It also adds a comment to know how to fetch a value without renewing
this timer.

This patch addresses github issue #615

This patch should be backported on all still supported branches
2022-05-31 10:29:36 +02:00
Willy Tarreau
0f4a02b81a DOC: peers: indicate that some server settings are not usable
Let's make it clear in the peers documentation that not all server
parameters may be used, as there is some confusion around this, and
the doc was even misleading by saying that all parameters were
supported.

This should address github issue #919.
2022-05-31 10:23:08 +02:00
Willy Tarreau
824c8c5999 BUG/MINOR: peers: detect and warn on init_addr/resolvers/check/agent-check
Some server keywords are currently silently ignored in the peers
section, which is not good because it wastes time on user-side, trying
to make something work while it cannot by design.

With this patch we at least report a few of them (the most common ones),
which are init_addr, resolvers, check, agent-check. Others might follow.

This may be backported to 2.5 to encourage some cleaning of bogus configs.
2022-05-31 09:42:44 +02:00
Willy Tarreau
245721b329 MINOR: server: indicate when no address was expected for a server
When parsing a peers section, it's particularly difficult to make the
difference between the local peer which doesn't have any address, and
other peers which need one, and the error messages do not help because
with just:

    peers foo
       bind :8001
       server foo 127.0.0.1:8001
       server bar 127.0.0.2:8001

One can get such a confusing message when the local peer is "bar":

  [peers.cfg:15] : 'server foo/bar' : unknown keyword '127.0.0.1:8001'.

It's not clear there why the other peer doesn't trigger an error.
With this commit we add a hint in the error message when no address
was expected. The error remains quite generic (since deep into the
server code) but at least the useer gets a hint about why the keyword
wasn't understood:

  [peers.cfg:15] : 'server foo/bar' : unknown keyword '127.0.0.1:8001'.
                   Hint: no address was expected for this server.
2022-05-31 09:25:34 +02:00
Willy Tarreau
356866acce BUG/MINOR: peers: set the proxy's name to the peers section name
For some poor historical reasons, the name of a peers proxy used to be
set to the name of the local peer itself. That causes some confusion when
multiple sections are present because the same proxy name appears at
multiple places in "show peers", but since 2.5 where parsing errors include
the proxy name, a config like this one :

   peers foo
       server foobar blah

Would report this when the local peer name isn't "foobar":

   'server (null)/foobar' : invalid address: 'blah' in 'blah'

And this when it is foobar:

   'server foobar/foobar' : invalid address: 'blah' in 'blah'

This is wrong, confusing and not very practical. This commit addresses
all this by using the peers section's name when it's created. This now
allows to report messages such as:

   'server foo/foobar' : invalid address: 'blah' in 'blah'

Which make it clear that the section is called "foo" and the server
"foobar".

This may be backported to 2.5, though the patch may be simplified if
needed, by just adding the change at the output of init_peers_frontend().
2022-05-31 09:10:19 +02:00
Willy Tarreau
50e77b2b85 CLEANUP: peers/cli: make peers_dump_peer() take an appctx instead of an stconn
By having the appctx in argument this function wouldn't have experienced
the previous bug. Better do that now to avoid proliferation of awkward
functions.
2022-05-31 08:55:54 +02:00
Willy Tarreau
fc5059958f CLEANUP: peers/cli: stop misusing the appctx local variable
In the context of a CLI command, it's particularly not welcome to use
an "appctx" variable that is not the current one. In addition it was
created for use at exactly 6 places in 2 lines. Let's just remove it
and stick to peer->appctx which is used elsewhere in the function and
is unambiguous.
2022-05-31 08:53:25 +02:00
Willy Tarreau
ccea010104 BUG/MEDIUM: peers/cli: fix "show peers" crash
Commit d0a06d52f ("CLEANUP: applet: use applet_put*() everywhere possible")
replaced most accesses to the conn_stream with simpler accesses to the
appctx. Unfortunately, in all the CLI functions using an appctx, one
makes an exception where the appctx is not the caller's but the one being
inspected! When no peers connection is active, the early exit immediately
crashes.

No backport is needed.
2022-05-31 08:49:29 +02:00
Willy Tarreau
55b9689bbe DOC: fix a few spelling mistakes in the docs
These were reported by the CI's spell checker:

   https://github.com/haproxy/haproxy/actions/runs/2411893527

A few need to be ignored ("ressources" and "trafic" being part of a URL).
2022-05-31 08:07:43 +02:00
Willy Tarreau
453d60be17 BUILD: makefile: reorder objects by build time
As usual, let's sort objects by inverse build time at -O2. It will
still vary based on the options but keeps them optimally sorted for
parallel builds.
2022-05-30 19:24:27 +02:00
Willy Tarreau
cc01730d26 EXAMPLES: remove completely outdated acl-content-sw.cfg
This config probably last worked on 1.3, maybe 1.4, but it uses too
many obsolete statements and it silently errors because of the "quiet"
directive, which adds to the confusion. Let's remove it.
2022-05-30 18:14:24 +02:00
Amaury Denoyelle
d5581d527c MINOR: h3: add traces on h3s init/end
Add events when h3s instances are created/initialized and released.
2022-05-30 17:37:50 +02:00
Amaury Denoyelle
a717eb7136 MINOR: h3: add traces on frame send
Add h3 traces events for several sent frames : SETTINGS, HEADERS and
DATA.
2022-05-30 17:36:39 +02:00
Amaury Denoyelle
494512d00f MINOR: h3: add traces on frame recv
Add h3 traces events for several received frames : SETTINGS, HEADERS and
DATA.
2022-05-30 17:35:57 +02:00
Amaury Denoyelle
016aa93088 MINOR: h3: define h3 trace module
A new 'h3' trace module is introduced. It will be used to centralize
events related to HTTP/3 status.
2022-05-30 17:34:51 +02:00
Amaury Denoyelle
6d98dbc3bf DOC: add maintainers for QUIC and HTTP/3
Frédéric Lécaille and Amaury Denoyelle are the official maintainers of
QUIC and HTTP/3.
2022-05-30 17:34:51 +02:00
Willy Tarreau
550101dc4b DOC: remove the outdated ROADMAP file
It's almost never update (last time was 3 years ago) and contains both
stuff that was already implemented and stuff that nobody's interested in
anymore. Let's remove it.
2022-05-30 17:01:39 +02:00
Willy Tarreau
a80f3b5ba7 DOC: internal: remove totally outdated diagrams
The "sequence" and "entities" diagrams have become so much outdated that
they are at best confusing, but more generally wrong. Let's simply remove
them.
2022-05-30 16:56:42 +02:00
Willy Tarreau
91a87918c9 BUILD: quic: use inttypes.h instead of stdint.h
The usual build joke on uncommon systems (AIX this time, though some
versions of Solaris are known for missing it as well).
2022-05-30 16:37:17 +02:00
Willy Tarreau
d46b5b94f0 BUILD: htx: use the unchecked version of htx_get_head_blk() where needed
stream.c and mux_fcgi.c may cause a warning for a possible NULL deref
at -Os, while that is not possible thanks to the previous test. Let's
just switch to __htx_get_head_blk() instead.
2022-05-30 16:27:48 +02:00
Willy Tarreau
771483da3e MINOR: htx: add an unchecked version of htx_get_head_blk()
htx_get_head_blk() is used at plenty of places, many of which are known
to be safe, but the function checks for the presence of a first block
and returns NULL if it doesn't exist. While it's properly used, it makes
compilers complain at -Os on stream.c and mux_fcgi.c because they probably
don't propagate variables far enough to see that there's no risk.

Let's add an unchecked version for these use cases.
2022-05-30 16:25:16 +02:00
Willy Tarreau
8e9f915f8f SCRIPTS: make publish-release try to launch make-releases-json
Now when publishing a release, if make-releases-json is usable at the same
place, it will be called to regenerate the json index of available versions.
2022-05-30 15:44:10 +02:00
Willy Tarreau
f1c6ccfc6a SCRIPTS: add make-releases-json to recreate a releases.json file in download dirs
This will be used to rebuild a releases.json file in each download
directory. It only relies on existing files and sorts them by version,
appends known signatures (md5/sha256) and marks the most recent one as
the latest release.

This aims at addressing github issue #1537.
2022-05-30 15:44:10 +02:00
Amaury Denoyelle
b93399a5e7 BUG/MINOR: h3: do not report bug on unknown method
Remove an unneeded BUG_ON statement when find_http_meth() returns
HTTP_METH_OTHER.

This fix is necessary to support requests with unusual methods with
DEBUG_STRICT activated. This was detected when browsing with HTTP/3 over
a nextcloud instance which uses PROPFIND method for Webdav.
2022-05-30 14:30:05 +02:00
Amaury Denoyelle
11f5a796c1 BUG/MINOR: qpack: support bigger prefix-integer encoding
Prefix-integer encoding function was incomplete. It was not able to deal
correctly with value encoded on more than 2 bytes. This maximum value depends
on the size of the prefix, but value greater than 254 were all impacted.

Most notably, this change is required to support header name/value with
sizeable length. Previously, length was incorrectly encoded. The client thus
closed the connection with QPACK_DECOMPRESSION_ERROR.
2022-05-30 14:30:05 +02:00
Amaury Denoyelle
5f6de8d77a BUG/MINOR: qpack: fix buffer API usage on prefix integer encoding
Replace bogus call b_data() by b_room() to check if there is enough
space left in the buffer before encoding a prefix integer.

At this moment, no real scenario was found to trigger a bug related to
this change. This is probably because the buffer always contains data
(field section line and status code) before calling
qpack_encode_prefix_integer() which prevents an occurrence of this bug.
2022-05-30 14:28:46 +02:00
Frédéric Lécaille
e06ca65e8d MINOR: quic: Do not drop packets with RESET_STREAM frames
If the connection client timeout has expired, the mux is released.
If the client decides to initiate a new request, we send a STOP_SENDING
frame. Then, the client endessly sends a RESET_STREAM frame.

At this time, we simulate the fact that we support the RESET_STREAM frame
thanks to this ridiculously minimalistic patch.
2022-05-30 09:59:26 +02:00
Frédéric Lécaille
4df2fe90c8 MINOR: quic: Send STOP_SENDING frames if mux is released
If the connection client timeout has expired, the mux is released.
If the client decides to initiate a new request, we do not ack its
request. This leads the client to endlessly sent it request.

This patch makes a QUIC listener send a STOP_SENDING frame in such
a situation.
2022-05-30 09:59:26 +02:00
Frédéric Lécaille
6f7607ef1f MINOR: h3: Add a statistics module for h3
Add ->inc_err_cnt new callback to qcc_app_ops struct which can
be called from xprt to increment the application level error code counters.
It take the application context as first parameter to be generic and support
new QUIC applications to come.
Add h3_stats.c module with counters for all the frame types and error codes.
2022-05-30 09:59:26 +02:00
Frédéric Lécaille
38dea05ca9 MINOR: quic: Connection TX buffer setting renaming.
Rename "tune.quic.conn-buf-limit" to "tune.quic.frontend.conn-tx-buffers.limit"
to reflect the stream direction (TX) and the objects (frontends) which are
concerned.
2022-05-30 09:59:26 +02:00
Frédéric Lécaille
f717a4bc7c DOC: quic: Documentation update for QUIC
Add minimalistic information about QUIC new protocol supported by QUIC.
2022-05-30 09:59:26 +02:00
Frédéric Lécaille
eb79145f01 MINOR: quic_stats: Add transport new counters (lost, stateless reset, drop)
Add new counters to count the number of dropped packet upon parsing error, lost
sent packets and the number of stateless reset packet sent.
Take the oppportunity of this patch to rename CONN_OPENINGS to QUIC_ST_HALF_OPEN_CONN
(total number of half open connections) and QUIC_ST_HDSHK_FAILS to QUIC_ST_HDSHK_FAIL.
2022-05-30 09:59:26 +02:00
Frédéric Lécaille
91a211fb08 BUG/MINOR: quic: Largest RX packet numbers mixing
When we select the next encryption level in qc_treat_rx_pkts() we
must reset the local largest_pn variable if we do not want to reuse its
previous value for this encryption. This bug could only happend during
handshake step and had no visible impact because this variable
is only used during the header protection removal step which hopefully
supports the packet reordering.
2022-05-30 09:59:26 +02:00
Frédéric Lécaille
3ccea6d276 MINOIR: quic_stats: add QUIC connection errors counters
Add statistical counters for all the transport level connection errrors.
2022-05-30 09:59:26 +02:00
Frédéric Lécaille
aee675746c MINOR: quic: Clarifications about transport parameters value
This is becoming difficult to distinguish the default values for
transport parameters which come with the RFC from our implementation
default values when not set by configuration (tunable parameters).
Add a comment to distinguish them.
Prefix these default values by QUIC_TP_DFLT_ to distinguish them from
QUIC_DFLT_* value even if there are not numerous.
Furthermore ->max_udp_payload_size must be first initialized to
QUIC_TP_DFLT_MAX_UDP_PAYLOAD_SIZE especially for received value.
2022-05-30 09:59:26 +02:00
Frédéric Lécaille
2674098569 MINOR: quic: Tunable "initial_max_streams_bidi" transport parameter
Add tunable "tune.quic.frontend.max_streams_bidi" setting for QUIC frontends
to set the "initial_max_streams_bidi" transport parameter.
Add some documentation for this new setting.
2022-05-30 09:59:26 +02:00
Frédéric Lécaille
1d96d6e024 MINOR: quic: Tunable "max_idle_timeout" transport parameter
Add two tunable settings both for backends and frontends "max_idle_timeout"
QUIC transport parameter, "tune.quic.frontend.max-idle-timeout" and
"tune.quic.backend.max-idle-timeout" respectively.
cfg_parse_quic_time() has been implemented to parse a time value thanks
to parse_time_err(). It should be reused for any tunable time value to be
parsed.
Add the documentation for this tunable setting only for frontend.
2022-05-30 09:59:26 +02:00
Frédéric Lécaille
aa8daed335 DOC: quic: Update documentation for QUIC Retry
Add some information for "quic-force-retry" and "tune.quic.retry-force"
settings.
2022-05-30 09:59:26 +02:00