]> git.ipfire.org Git - thirdparty/haproxy.git/log
thirdparty/haproxy.git
3 years agoDEV: tcploop: factor out the socket creation
Willy Tarreau [Tue, 7 Jun 2022 09:55:45 +0000 (11:55 +0200)] 
DEV: tcploop: factor out the socket creation

This will later permit to separately bind() before connect(). Let's
first deal with existing sockets.

3 years agoDEV: tcploop: make it possible to change the target address of a connect()
Willy Tarreau [Tue, 7 Jun 2022 09:46:57 +0000 (11:46 +0200)] 
DEV: tcploop: make it possible to change the target address of a connect()

Sometimes it's more convenient to be able to specify where to connect on
the connect() statement, let's make it possible to pass it in argument to
the C command.

3 years agoDEV: tcploop: make the current address the default address
Willy Tarreau [Tue, 7 Jun 2022 09:36:20 +0000 (11:36 +0200)] 
DEV: tcploop: make the current address the default address

It's difficult to refine bind/connect right now, let's make the address
optionall by turning it to the default one.

3 years agoDEV: tcploop: reorder options in the usage message
Willy Tarreau [Tue, 7 Jun 2022 09:29:16 +0000 (11:29 +0200)] 
DEV: tcploop: reorder options in the usage message

Options have become difficult to find, let's reorder them alphabetically.

3 years agoBUILD: compiler: implement unreachable for older compilers too
Willy Tarreau [Wed, 8 Jun 2022 10:14:23 +0000 (12:14 +0200)] 
BUILD: compiler: implement unreachable for older compilers too

Benoit Dolez reported that gcc-4.4 emits several "may be used
uninitialized" warnings around places where there are BUG_ON()
or ABORT_NOW(). The reason is that __builtin_unreachable() was
introduced in gcc-4.5 thus older ones do not know that the code
after such statements is not reachable.

This patch solves the problem by deplacing the statement with
an infinite loop on older versions. The compiler knows that the
code following it cannot be reached, and this is quite cheap
(2 to 4 bytes depending on architectures). It even reduces the
code size a little bit as the compiler doesn't have to optimize
for branches that do not exist.

This may be backported to older versions.

3 years agoBUILD: quic: fix anonymous union for gcc-4.4
Benoit DOLEZ [Wed, 8 Jun 2022 07:28:56 +0000 (09:28 +0200)] 
BUILD: quic: fix anonymous union for gcc-4.4

Building QUIC with gcc-4.4 on el6 shows this error:

src/xprt_quic.c: In function 'qc_release_lost_pkts':
src/xprt_quic.c:1905: error: unknown field 'loss' specified in initializer
compilation terminated due to -Wfatal-errors.
make: *** [src/xprt_quic.o] Error 1
make: *** Waiting for unfinished jobs....

Initializing an anonymous form of union like :
     struct quic_cc_event ev = {
          (...)
          .loss.time_sent = newest_lost->time_sent,
          (...)
     };

generates an error with gcc-4.4 but not when initializing the
fields outside of the declaration.

3 years agoBUG/MINOR: h3: fix return value on decode_qcs on error
Amaury Denoyelle [Tue, 7 Jun 2022 16:24:34 +0000 (18:24 +0200)] 
BUG/MINOR: h3: fix return value on decode_qcs on error

Convert return code to -1 when an error has been detected. This is
required since the previous API change on return value from the patch :

  1f21ebdd7686bf435682cacd31e635db0c65b061
  MINOR: mux-quic/h3: adjust demuxing function return values

Without this, QUIC MUX won't consider the call as an error and will try
to remove one byte from the buffer. This may cause a BUG_ON failure if
the buffer is empty at this stage.

This bug was introduced in the current dev tree. Does not need to be
backported.

3 years agoMINOR: mux-quic/h3: adjust demuxing function return values
Amaury Denoyelle [Tue, 7 Jun 2022 15:30:55 +0000 (17:30 +0200)] 
MINOR: mux-quic/h3: adjust demuxing function return values

Clean the API used by decode_qcs() and transcoder internal functions.
Parsing functions now returns a ssize_t which represents the number of
consumed bytes or a negative error code. The total consumed bytes is
returned via decode_qcs().

The API is now unified and cleaner. The MUX can thus simply use the
return value of decode_qcs() instead of substracting the data bytes in
the buffer before and after the call. Transcoders functions are not
anymore obliged to remove consumed bytes from the buffer which was not
obvious.

3 years agoMINOR: mux-quic: simplify decode_qcs API
Amaury Denoyelle [Fri, 3 Jun 2022 14:40:34 +0000 (16:40 +0200)] 
MINOR: mux-quic: simplify decode_qcs API

Slightly modify decode_qcs function used by transcoders. The MUX now
gives a buffer instance on which each transcoder is free to work on it.
At the return of the function, the MUX removes consume data from its own
buffer.

This reduces the number of invocation to qcs_consume at the end of a
full demuxing process. The API is also cleaner with the transcoders not
responsible of calling it with the risk of having the input buffer
freed if empty.

3 years agoMINOR: h3: add h3c pointer into h3s instance
Amaury Denoyelle [Fri, 3 Jun 2022 13:29:07 +0000 (15:29 +0200)] 
MINOR: h3: add h3c pointer into h3s instance

As a mirror to qcc/qcs types, add a h3c pointer into h3s struct. This
should help to clean up H3 code and avoid to use qcs.qcc.ctx to retrieve
the h3c instance.

3 years agoMINOR: connection: support HTTP/3.0 for smp_*_http_major fetch
Amaury Denoyelle [Tue, 7 Jun 2022 09:57:20 +0000 (11:57 +0200)] 
MINOR: connection: support HTTP/3.0 for smp_*_http_major fetch

smp_fc_http_major may be used to return the http version as an integer
used on the frontend or backend side. Previously, the handler only
checked for version 2 or 1 as a fallback. Extend it to support version 3
with the QUIC mux.

3 years agoREGTESTS: restrict_req_hdr_names: Extend supported versions
Christopher Faulet [Tue, 7 Jun 2022 06:21:18 +0000 (08:21 +0200)] 
REGTESTS: restrict_req_hdr_names: Extend supported versions

This reg-test was backported as far as 2.0. Thus, extend supported versions
accordingly.

This patch must be backported as far as 2.0.

3 years agoREGTESTS: http_abortonclose: Extend supported versions
Christopher Faulet [Tue, 7 Jun 2022 06:20:12 +0000 (08:20 +0200)] 
REGTESTS: http_abortonclose: Extend supported versions

This reg-test was backported as far as 2.0. Thus, extend supported versions
accordingly.

This patch must be backported as far as 2.0.

3 years agoBUG/MINOR: ssl_ckch: Fix another possible uninitialized value
Christopher Faulet [Fri, 3 Jun 2022 14:34:30 +0000 (16:34 +0200)] 
BUG/MINOR: ssl_ckch: Fix another possible uninitialized value

Commit d6c66f06a ("MINOR: ssl_ckch: Remove service context for "set ssl
crl-file" command") introduced a regression leading to a build error because
of a possible uninitialized value. It is now fixed.

This patch must be backported as far as 2.5.

3 years agoBUILD: ssl_ckch: Fix build error about a possible uninitialized value
Christopher Faulet [Fri, 3 Jun 2022 14:37:31 +0000 (16:37 +0200)] 
BUILD: ssl_ckch: Fix build error about a possible uninitialized value

A build error is reported about the path variable in the switch statement on
the commit type, in cli_io_handler_commit_cafile_crlfile() function. The
enum contains only 2 values, but a default clause has been added to return an
error to make GCC happy.

This patch must be backported as far as 2.5.

3 years agoBUG/MINOR: ssl_ckch: Fix possible uninitialized value in show_crlfile I/O handler
Christopher Faulet [Fri, 3 Jun 2022 14:26:56 +0000 (16:26 +0200)] 
BUG/MINOR: ssl_ckch: Fix possible uninitialized value in show_crlfile I/O handler

Commit 9a99e5478 ("BUG/MINOR: ssl_ckch: Dump CRL transaction only once if
show command yield") introduced a regression leading to a build error
because of a possible uninitialized value. It is now fixed.

This patch must be backported as far as 2.5.

3 years agoBUG/MINOR: ssl_ckch: Fix possible uninitialized value in show_cafile I/O handler
Christopher Faulet [Fri, 3 Jun 2022 14:25:35 +0000 (16:25 +0200)] 
BUG/MINOR: ssl_ckch: Fix possible uninitialized value in show_cafile I/O handler

Commit 5a2154bf7 ("BUG/MINOR: ssl_ckch: Dump CA transaction only once if
show command yield") introduced a regression leading to a build error
because of a possible uninitialized value. It is now fixed.

This patch must be backported as far as 2.5.

3 years agoBUG/MINOR: ssl_ckch: Fix possible uninitialized value in show_cert I/O handler
Christopher Faulet [Fri, 3 Jun 2022 14:24:02 +0000 (16:24 +0200)] 
BUG/MINOR: ssl_ckch: Fix possible uninitialized value in show_cert I/O handler

Commit 3e94f5d4b ("BUG/MINOR: ssl_ckch: Dump cert transaction only once if
show command yield") introduced a regression leading to a build error
because of a possible uninitialized value. It is now fixed.

This patch must be backported as far as 2.2.

3 years agoMINOR: ssl_ckch: Remove service context for "set ssl crl-file" command
Christopher Faulet [Fri, 3 Jun 2022 09:59:10 +0000 (11:59 +0200)] 
MINOR: ssl_ckch: Remove service context for "set ssl crl-file" command

This command does not have I/O handle function. All is done in the command
parsing function. So there is no reason to have dedicated context.

3 years agoMINOR: ssl_ckch: Remove service context for "set ssl ca-file" command
Christopher Faulet [Fri, 3 Jun 2022 09:56:26 +0000 (11:56 +0200)] 
MINOR: ssl_ckch: Remove service context for "set ssl ca-file" command

This command does not have I/O handle function. All is done in the command
parsing function. So there is no reason to have dedicated context.

3 years agoMINOR: ssl_ckch: Remove service context for "set ssl cert" command
Christopher Faulet [Fri, 3 Jun 2022 09:50:40 +0000 (11:50 +0200)] 
MINOR: ssl_ckch: Remove service context for "set ssl cert" command

This command does not have I/O handle function. All is done in the command
parsing function. So there is no reason to have dedicated context.

3 years agoMINOR: ssl_ckch: Simplify structure used to commit changes on CA/CRL entries
Christopher Faulet [Fri, 3 Jun 2022 09:42:38 +0000 (11:42 +0200)] 
MINOR: ssl_ckch: Simplify structure used to commit changes on CA/CRL entries

The same type is used for CA and CRL entries. So, in commit_cert_ctx
structure, there is no reason to have different fields for the CA and CRL
entries.

3 years agoCLEANUP: ssl_ckch: Remove unused field in commit_cacrlfile_ctx structure
Christopher Faulet [Fri, 3 Jun 2022 09:35:37 +0000 (11:35 +0200)] 
CLEANUP: ssl_ckch: Remove unused field in commit_cacrlfile_ctx structure

.next_ckchi field is not used by functions responsible to commit changes on
CA/CRL entries. It can be removed.

3 years agoBUG/MINOR: ssl_ckch: Init right field when parsing "commit ssl crl-file" cmd
Christopher Faulet [Fri, 3 Jun 2022 09:32:05 +0000 (11:32 +0200)] 
BUG/MINOR: ssl_ckch: Init right field when parsing "commit ssl crl-file" cmd

.next_ckchi_link field must be initialized to NULL instead of .next_ckchi in
cli_parse_commit_crlfile() function. Only '.nex_ckchi_link' is used in the
I/O handler.

This patch must be backported as far as 2.5 with some adaptations for the 2.5.

3 years agoBUG/MINOR: ssl_ckch: Dump cert transaction only once if show command yield
Christopher Faulet [Fri, 3 Jun 2022 08:46:40 +0000 (10:46 +0200)] 
BUG/MINOR: ssl_ckch: Dump cert transaction only once if show command yield

When loaded SSL certificates are displayed via "show ssl cert" command, the
in-progess transaction, if any, is also displayed. However, if the command
yield, the transaction is re-displayed again and again.

To fix the issue, old_ckchs field is used to remember the transaction was
already displayed.

This patch must be backported as far as 2.2.

3 years agoBUG/MINOR: ssl_ckch: Dump CA transaction only once if show command yield
Christopher Faulet [Fri, 3 Jun 2022 08:42:48 +0000 (10:42 +0200)] 
BUG/MINOR: ssl_ckch: Dump CA transaction only once if show command yield

When loaded CA files are displayed via "show ssl ca-file" command, the
in-progress transaction, if any, is also displayed. However, if the command
yield, the transaction is re-displayed again and again.

To fix the issue, old_cafile_entry field is used to remember the transaction
was already displayed.

This patch must be backported as far as 2.5.

3 years agoBUG/MINOR: ssl_ckch: Dump CRL transaction only once if show command yield
Christopher Faulet [Fri, 3 Jun 2022 08:32:18 +0000 (10:32 +0200)] 
BUG/MINOR: ssl_ckch: Dump CRL transaction only once if show command yield

When loaded CRL files are displayed via "show ssl crl-file" command, the
in-progess transaction, if any, is also displayed. However, if the command
yield, the transaction is re-displayed again and again.

To fix the issue, old_crlfile_entry field is used to remember the transaction
was already displayed.

This patch must be backported as far as 2.5.

3 years agoBUG/MINOR: ssl_ckch: Use right type for old entry in show_crlfile_ctx
Christopher Faulet [Fri, 3 Jun 2022 08:21:27 +0000 (10:21 +0200)] 
BUG/MINOR: ssl_ckch: Use right type for old entry in show_crlfile_ctx

Because of a typo (I guess), an unknown type is used for the old entry in
show_crlfile_ctx structure. Because this field is unused, there is no
compilation error. But it must be a cafile_entry and not a crlfile_entry.

Note this field is not used for now, but it will be used.

This patch must be backported to 2.6.

3 years agoMINOR: ssl_ckch: Simplify I/O handler to commit changes on CA/CRL entry
Christopher Faulet [Fri, 3 Jun 2022 07:00:09 +0000 (09:00 +0200)] 
MINOR: ssl_ckch: Simplify I/O handler to commit changes on CA/CRL entry

Simplify cli_io_handler_commit_cafile_crlfile() handler function by
retrieving old and new entries at the beginning. In addition the path is
also retrieved at this stage. This removes several switch statements.

Note that the ctx was already validated by the corresponding parsing
function. Thus there is no reason to test the pointers.

While it is not a bug, this patch may help to fix issue #1731.

3 years agoCLEANUP: ssl_ckch: Use corresponding enum for commit_cacrlfile_ctx.cafile_type
Christopher Faulet [Fri, 3 Jun 2022 07:17:09 +0000 (09:17 +0200)] 
CLEANUP: ssl_ckch: Use corresponding enum for commit_cacrlfile_ctx.cafile_type

There is an enum to determine the entry entry type when changes are
committed on a CA/CRL entry. So use it in the service context instead of an
integer.

This patch may help to fix issue #1731.

3 years agoREGTESTS: http_request_buffer: Increase client timeout to wait "slow" clients
Christopher Faulet [Thu, 2 Jun 2022 12:01:30 +0000 (14:01 +0200)] 
REGTESTS: http_request_buffer: Increase client timeout to wait "slow" clients

The default client timeout is too small to be sure to always wait end of
slow clients (the last 2 clients use a delay to send their request). But it
cannot be increased because it will slow down the regtest execution. So a
dedicated frontend with a higher client timeout has been added. This
frontend is used by "slow" clients. The other one is used for normal
requests.

3 years agoREGTESTS: abortonclose: Add a barrier to not mix up log messages
Christopher Faulet [Thu, 2 Jun 2022 11:56:00 +0000 (13:56 +0200)] 
REGTESTS: abortonclose: Add a barrier to not mix up log messages

Depending on the timing, time to time, the log message for "/c4" request can
be received before the one for "/c2" request. To (hopefully) fix the issue,
a barrier has been added to wait "/c2" log message before sending other
requests.

3 years agoCLEANUP: Re-apply xalloc_size.cocci (2)
Tim Duesterhus [Wed, 1 Jun 2022 19:58:37 +0000 (21:58 +0200)] 
CLEANUP: Re-apply xalloc_size.cocci (2)

This reapplies the xalloc_size.cocci patch across the whole `src/` tree.

see 16cc16dd8235e7eb6c38b7abd210bd1e1d96b1d9
see 63ee0e4c01b94aee5fc6c6dd98cfc4480ae5ea46

3 years agoMEDIUM: http-ana: Always report rewrite failures as PRXCOND in logs
Christopher Faulet [Wed, 1 Jun 2022 15:42:35 +0000 (17:42 +0200)] 
MEDIUM: http-ana: Always report rewrite failures as PRXCOND in logs

Rewrite failures in http rules are reported as proxy errors (PRXCOND) in
logs. However, other rewrite errors are reported as internal errors. For
instance, it happens when we fail to add X-Forwarded-For header. It is not
consistent and it is confusing. So now, all rewite failures are reported as
proxy errors.

This patch may be backported if necessary.

3 years agoMEDIUM: httpclient: Don't close CLI applet at the end of a response
Christopher Faulet [Wed, 1 Jun 2022 15:17:24 +0000 (17:17 +0200)] 
MEDIUM: httpclient: Don't close CLI applet at the end of a response

There is no reason to close the CLI applet when the whole response was
dumped. This prevent anyone to use the CLI in interactive mode.

3 years agoBUG/MEDIUM: httpclient: Rework CLI I/O handler to handle full buffer cases
Christopher Faulet [Wed, 1 Jun 2022 15:08:19 +0000 (17:08 +0200)] 
BUG/MEDIUM: httpclient: Rework CLI I/O handler to handle full buffer cases

'httpclient' command does not properly handle full buffer cases. When the
response buffer is full, we exit to retry later. However, the context flags
are updated. It means when this happens, we may loose a part of the
response.

So now, flags are preserved when we fail to push data into the response
buffer. In addition, instead of dumping one part per call, we now try to
dump as much data as possible.

Finally, when there is no more data, because everything was dumped or
because we are waiting for more data from the HTTP client, the applet is
updated accordingly by calling applet_have_no_more_data(). Otherwise, when
some data are blocked, applet_putchk() already takes care to update the SE
flags. So, it is useless to call sc_need_room().

This patch should fix the issue #1723. It must be backported as far as
2.5. But a massive refactoring was performed in 2.6. So, for the 2.5 and
below, the patch will have to be adapted.

3 years agoBUG/MEDIUM: httpclient: Don't remove HTX header blocks before duplicating them
Christopher Faulet [Wed, 1 Jun 2022 14:37:49 +0000 (16:37 +0200)] 
BUG/MEDIUM: httpclient: Don't remove HTX header blocks before duplicating them

Commit 534645d6 ("BUG/MEDIUM: httpclient: Fix loop consuming HTX blocks from
the response channel") introduced a regression. When the response is
consumed, The HTX header blocks are removed before duplicating them. Thus,
the first header block is always lost.

This patch must be backported as far as 2.5.

3 years agoBUG/MEDIUM: ssl/crt-list: Rework 'add ssl crt-list' to handle full buffer cases
Christopher Faulet [Wed, 1 Jun 2022 14:31:09 +0000 (16:31 +0200)] 
BUG/MEDIUM: ssl/crt-list: Rework 'add ssl crt-list' to handle full buffer cases

'add ssl crt-list' command is also concerned. This patch is similar to the
previous ones. Full buffer cases when we try to push the reply are not
properly handled. To fix the issue, the functions responsible to add a
crt-list entry were reworked.

First, the error message is now part of the service context. This way, if we
cannot push the error message in the reponse buffer, we may retry later. To
do so, a dedicated state was created (ADDCRT_ST_ERROR,). Then, the success
message is also handled in a dedicated state (ADDCRT_ST_SUCCESS). This way
we are able to retry to push it if necessary. Finally, the dot displayed for
each new instance is now immediatly pushed in the response buffer, and
before the update. This way, we are able to retry too if necessary.

This patch should fix the issue #1724. It must be backported as far as
2.2. But a massive refactoring was performed in 2.6. So, for the 2.5 and
below, the patch will have to be adapted.

3 years agoBUG/MEDIUM: ssl_ckch: Rework 'commit ssl ca-file' to handle full buffer cases
Christopher Faulet [Tue, 31 May 2022 15:51:06 +0000 (17:51 +0200)] 
BUG/MEDIUM: ssl_ckch: Rework 'commit ssl ca-file' to handle full buffer cases

'commit ssl crl-file' command is also concerned. This patch is similar to
the previous one. Full buffer cases when we try to push the reply are not
properly handled. To fix the issue, the functions responsible to commit CA
or CRL entry changes were reworked.

First, the error message is now part of the service context. This way, if we
cannot push the error message in the reponse buffer, we may retry later. To
do so, a dedicated state was created (CACRL_ST_ERROR). Then, the success
message is also handled in a dedicated state (CACRL_ST_SUCCESS). This way we
are able to retry to push it if necessary. Finally, the dot displayed for
each updated CKCH instance is now immediatly pushed in the response buffer,
and before the update. This way, we are able to retry too if necessary.

This patch should fix the issue #1722. It must be backported as far as
2.5. But a massive refactoring was performed in 2.6. So, for the 2.5, the
patch will have to be adapted.

3 years agoBUG/MEDIUM: ssl_ckch: Rework 'commit ssl cert' to handle full buffer cases
Christopher Faulet [Tue, 31 May 2022 14:37:01 +0000 (16:37 +0200)] 
BUG/MEDIUM: ssl_ckch: Rework 'commit ssl cert' to handle full buffer cases

When changes on a certificate are commited, a trash buffer is used to create
the response. Once done, the message is copied in the response buffer.
However, if the buffer is full, there is no way to retry and the message is
lost. The same issue may happen with the error message. It is a design issue
of cli_io_handler_commit_cert() function.

To fix it, the function was reworked. First, the error message is now part
of the service context. This way, if we cannot push the error message in the
reponse buffer, we may retry later. To do so, a dedicated state was created
(CERT_ST_ERROR). Then, the success message is also handled in a dedicated
state (CERT_ST_SUCCESS). This way we are able to retry to push it if
necessary. Finally, the dot displayed for each updated CKCH instance is now
immediatly pushed in the response buffer, and before the update. This way,
we are able to retry too if necessary.

This patch should fix the issue #1725. It must be backported as far as
2.2. But massive refactoring was performed in 2.6. So, for the 2.5 and
below, the patch must be adapted.

3 years agoBUG/MINOR: ssl_ckch: Don't duplicate path when replacing a CA/CRL entry
Christopher Faulet [Tue, 31 May 2022 16:10:19 +0000 (18:10 +0200)] 
BUG/MINOR: ssl_ckch: Don't duplicate path when replacing a CA/CRL entry

When a CA or CRL entry is replaced (via 'set ssl ca-file' or 'set ssl
crl-file' commands), the path is duplicated and used to identify the ongoing
transaction. However, if the same command is repeated, the path is still
duplicated but the transaction is not changed and the duplicated path is not
released. Thus there is a memory leak.

By reviewing the code, it appears there is no reason to duplicate the
path. It is always the filename path of the old entry. So, a reference on it
is now used. This simplifies the code and this fixes the memory leak.

This patch must be backported as far as 2.5.

3 years agoBUG/MINOR: ssl_ckch: Don't duplicate path when replacing a cert entry
Christopher Faulet [Tue, 31 May 2022 16:07:59 +0000 (18:07 +0200)] 
BUG/MINOR: ssl_ckch: Don't duplicate path when replacing a cert entry

When a certificate entry is replaced (via 'set ssl cert' command), the path
is duplicated and used to identify the ongoing transaction. However, if the
same command is repeated, the path is still duplicated but the transaction
is not changed and the duplicated path is not released. Thus there is a
memory leak.

By reviewing the code, it appears there is no reason to duplicate the
path. It is always the path of the old entry. So, a reference on it is now
used. This simplifies the code and this fixes the memory leak.

This patch must be backported as far as 2.2.

3 years agoBUG/MEDIUM: ssl_ckch: Don't delete CA/CRL entry if it is being modified
Christopher Faulet [Tue, 31 May 2022 16:06:30 +0000 (18:06 +0200)] 
BUG/MEDIUM: ssl_ckch: Don't delete CA/CRL entry if it is being modified

When a CA or a CRL entry is being modified, we must take care to no delete
it because the corresponding ongoing transaction still references it. If we
do so, it leads to a null-deref and a crash may be exeperienced if changes
are commited.

This patch must be backported as far as 2.5.

3 years agoBUG/MEDIUM: ssl_ckch: Don't delete a cert entry if it is being modified
Christopher Faulet [Tue, 31 May 2022 16:04:25 +0000 (18:04 +0200)] 
BUG/MEDIUM: ssl_ckch: Don't delete a cert entry if it is being modified

When a certificate entry is being modified, we must take care to no delete
it because the corresponding ongoing transaction still references it. If we
do so, it leads to a null-deref and a crash may be exeperienced if changes
are commited.

This patch must be backported as far as 2.2.

3 years agoBUG/MINOR: ssl_ckch: Free error msg if commit changes on a CA/CRL entry fails
Christopher Faulet [Tue, 31 May 2022 16:03:26 +0000 (18:03 +0200)] 
BUG/MINOR: ssl_ckch: Free error msg if commit changes on a CA/CRL entry fails

On the CLI, If we fail to commit changes on a CA or a CRL entry, an error
message is returned. This error must be released.

This patch must be backported as far as 2.4.

3 years agoBUG/MINOR: ssl_ckch: Free error msg if commit changes on a cert entry fails
Christopher Faulet [Tue, 31 May 2022 16:02:30 +0000 (18:02 +0200)] 
BUG/MINOR: ssl_ckch: Free error msg if commit changes on a cert entry fails

On the CLI, If we fail to commit changes on a certificate entry, an error
message is returned. This error must be released.

This patch must be backported as far as 2.2.

3 years ago[RELEASE] Released version 2.7-dev0 v2.7-dev0
Willy Tarreau [Tue, 31 May 2022 15:05:27 +0000 (17:05 +0200)] 
[RELEASE] Released version 2.7-dev0

Released version 2.7-dev0 with the following main changes :
    - MINOR: version: it's development again

3 years agoMINOR: version: it's development again
Willy Tarreau [Tue, 31 May 2022 15:04:45 +0000 (17:04 +0200)] 
MINOR: version: it's development again

This essentially reverts b2c1e081f7f61d16697a6c6d8312062baf291eb6.

3 years ago[RELEASE] Released version 2.6.0 v2.6.0
Willy Tarreau [Tue, 31 May 2022 14:58:21 +0000 (16:58 +0200)] 
[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.

3 years agoMINOR: version: mention that it's LTS now.
Willy Tarreau [Tue, 31 May 2022 14:53:13 +0000 (16:53 +0200)] 
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.

3 years agoDOC: intro: adjust the numbering of paragrams to keep the output ordered
Willy Tarreau [Tue, 31 May 2022 14:23:06 +0000 (16:23 +0200)] 
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".

3 years agoBUG/MINOR: qpack: do not consider empty enc/dec stream as error
Amaury Denoyelle [Tue, 31 May 2022 13:21:27 +0000 (15:21 +0200)] 
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.

3 years agoCLEANUP: quic: remove useless check on local UNI stream reception
Amaury Denoyelle [Tue, 31 May 2022 13:17:02 +0000 (15:17 +0200)] 
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.

3 years agoBUG/MINOR: quic: Fix QUIC_EV_CONN_PRSAFRM event traces
Frédéric Lécaille [Tue, 31 May 2022 10:04:42 +0000 (12:04 +0200)] 
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.

3 years agoBUG/MEDIUM: h3: fix H3_EXCESSIVE_LOAD when receiving H3 frame header only
Amaury Denoyelle [Tue, 31 May 2022 12:18:33 +0000 (14:18 +0200)] 
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.

3 years agoBUG/MINOR: h3: fix frame demuxing
Amaury Denoyelle [Tue, 31 May 2022 09:44:52 +0000 (11:44 +0200)] 
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.

3 years agoMINOR: ncbuf: adjust ncb_data with NCBUF_NULL
Amaury Denoyelle [Tue, 31 May 2022 09:44:25 +0000 (11:44 +0200)] 
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.

3 years agoDOC: install: update supported OpenSSL versions in the INSTALL doc
Willy Tarreau [Tue, 31 May 2022 09:37:37 +0000 (11:37 +0200)] 
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.

3 years agoDOC: gpc/gpt: add commments of gpc/gpt array definitions on stick tables.
Emeric Brun [Fri, 25 Mar 2022 13:13:23 +0000 (14:13 +0100)] 
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.

3 years agoDOC: peers: fix port number and addresses on new peers section format
Emeric Brun [Mon, 30 May 2022 16:13:35 +0000 (18:13 +0200)] 
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

3 years agoDOC: peers: clarify when entry expiration date is renewed.
Emeric Brun [Mon, 30 May 2022 16:08:28 +0000 (18:08 +0200)] 
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

3 years agoDOC: peers: indicate that some server settings are not usable
Willy Tarreau [Tue, 31 May 2022 08:22:12 +0000 (10:22 +0200)] 
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.

3 years agoBUG/MINOR: peers: detect and warn on init_addr/resolvers/check/agent-check
Willy Tarreau [Tue, 31 May 2022 07:42:44 +0000 (09:42 +0200)] 
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.

3 years agoMINOR: server: indicate when no address was expected for a server
Willy Tarreau [Tue, 31 May 2022 07:25:34 +0000 (09:25 +0200)] 
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.

3 years agoBUG/MINOR: peers: set the proxy's name to the peers section name
Willy Tarreau [Tue, 31 May 2022 07:10:19 +0000 (09:10 +0200)] 
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().

3 years agoCLEANUP: peers/cli: make peers_dump_peer() take an appctx instead of an stconn
Willy Tarreau [Tue, 31 May 2022 06:55:54 +0000 (08:55 +0200)] 
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.

3 years agoCLEANUP: peers/cli: stop misusing the appctx local variable
Willy Tarreau [Tue, 31 May 2022 06:53:25 +0000 (08:53 +0200)] 
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.

3 years agoBUG/MEDIUM: peers/cli: fix "show peers" crash
Willy Tarreau [Tue, 31 May 2022 06:49:29 +0000 (08:49 +0200)] 
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.

3 years agoDOC: fix a few spelling mistakes in the docs
Willy Tarreau [Tue, 31 May 2022 06:07:43 +0000 (08:07 +0200)] 
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).

3 years agoBUILD: makefile: reorder objects by build time
Willy Tarreau [Mon, 30 May 2022 17:24:27 +0000 (19:24 +0200)] 
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.

3 years agoEXAMPLES: remove completely outdated acl-content-sw.cfg
Willy Tarreau [Mon, 30 May 2022 16:14:24 +0000 (18:14 +0200)] 
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.

3 years agoMINOR: h3: add traces on h3s init/end
Amaury Denoyelle [Mon, 30 May 2022 13:51:31 +0000 (15:51 +0200)] 
MINOR: h3: add traces on h3s init/end

Add events when h3s instances are created/initialized and released.

3 years agoMINOR: h3: add traces on frame send
Amaury Denoyelle [Mon, 30 May 2022 13:51:01 +0000 (15:51 +0200)] 
MINOR: h3: add traces on frame send

Add h3 traces events for several sent frames : SETTINGS, HEADERS and
DATA.

3 years agoMINOR: h3: add traces on frame recv
Amaury Denoyelle [Mon, 30 May 2022 13:50:34 +0000 (15:50 +0200)] 
MINOR: h3: add traces on frame recv

Add h3 traces events for several received frames : SETTINGS, HEADERS and
DATA.

3 years agoMINOR: h3: define h3 trace module
Amaury Denoyelle [Mon, 30 May 2022 13:49:36 +0000 (15:49 +0200)] 
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.

3 years agoDOC: add maintainers for QUIC and HTTP/3
Amaury Denoyelle [Mon, 30 May 2022 15:32:21 +0000 (17:32 +0200)] 
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.

3 years agoDOC: remove the outdated ROADMAP file
Willy Tarreau [Mon, 30 May 2022 15:00:26 +0000 (17:00 +0200)] 
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.

3 years agoDOC: internal: remove totally outdated diagrams
Willy Tarreau [Mon, 30 May 2022 14:56:42 +0000 (16:56 +0200)] 
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.

3 years agoBUILD: quic: use inttypes.h instead of stdint.h
Willy Tarreau [Mon, 30 May 2022 14:37:17 +0000 (16:37 +0200)] 
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).

3 years agoBUILD: htx: use the unchecked version of htx_get_head_blk() where needed
Willy Tarreau [Mon, 30 May 2022 14:27:48 +0000 (16:27 +0200)] 
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.

3 years agoMINOR: htx: add an unchecked version of htx_get_head_blk()
Willy Tarreau [Mon, 30 May 2022 14:25:16 +0000 (16:25 +0200)] 
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.

3 years agoSCRIPTS: make publish-release try to launch make-releases-json
Willy Tarreau [Mon, 30 May 2022 13:34:51 +0000 (15:34 +0200)] 
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.

3 years agoSCRIPTS: add make-releases-json to recreate a releases.json file in download dirs
Willy Tarreau [Mon, 30 May 2022 13:19:06 +0000 (15:19 +0200)] 
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.

3 years agoBUG/MINOR: h3: do not report bug on unknown method
Amaury Denoyelle [Mon, 30 May 2022 08:18:46 +0000 (10:18 +0200)] 
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.

3 years agoBUG/MINOR: qpack: support bigger prefix-integer encoding
Amaury Denoyelle [Mon, 30 May 2022 12:24:40 +0000 (14:24 +0200)] 
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.

3 years agoBUG/MINOR: qpack: fix buffer API usage on prefix integer encoding
Amaury Denoyelle [Mon, 30 May 2022 09:58:06 +0000 (11:58 +0200)] 
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.

3 years agoMINOR: quic: Do not drop packets with RESET_STREAM frames
Frédéric Lécaille [Sun, 29 May 2022 09:48:58 +0000 (11:48 +0200)] 
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.

3 years agoMINOR: quic: Send STOP_SENDING frames if mux is released
Frédéric Lécaille [Sun, 29 May 2022 09:36:03 +0000 (11:36 +0200)] 
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.

3 years agoMINOR: h3: Add a statistics module for h3
Frédéric Lécaille [Wed, 25 May 2022 20:25:37 +0000 (22:25 +0200)] 
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.

3 years agoMINOR: quic: Connection TX buffer setting renaming.
Frédéric Lécaille [Wed, 25 May 2022 15:14:28 +0000 (17:14 +0200)] 
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.

3 years agoDOC: quic: Documentation update for QUIC
Frédéric Lécaille [Wed, 25 May 2022 13:42:15 +0000 (15:42 +0200)] 
DOC: quic: Documentation update for QUIC

Add minimalistic information about QUIC new protocol supported by QUIC.

3 years agoMINOR: quic_stats: Add transport new counters (lost, stateless reset, drop)
Frédéric Lécaille [Tue, 24 May 2022 14:01:39 +0000 (16:01 +0200)] 
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.

3 years agoBUG/MINOR: quic: Largest RX packet numbers mixing
Frédéric Lécaille [Tue, 24 May 2022 08:54:42 +0000 (10:54 +0200)] 
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.

3 years agoMINOIR: quic_stats: add QUIC connection errors counters
Frédéric Lécaille [Mon, 23 May 2022 20:54:54 +0000 (22:54 +0200)] 
MINOIR: quic_stats: add QUIC connection errors counters

Add statistical counters for all the transport level connection errrors.

3 years agoMINOR: quic: Clarifications about transport parameters value
Frédéric Lécaille [Mon, 23 May 2022 16:29:39 +0000 (18:29 +0200)] 
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.

3 years agoMINOR: quic: Tunable "initial_max_streams_bidi" transport parameter
Frédéric Lécaille [Mon, 23 May 2022 15:28:01 +0000 (17:28 +0200)] 
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.

3 years agoMINOR: quic: Tunable "max_idle_timeout" transport parameter
Frédéric Lécaille [Mon, 23 May 2022 14:38:14 +0000 (16:38 +0200)] 
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.

3 years agoDOC: quic: Update documentation for QUIC Retry
Frédéric Lécaille [Mon, 23 May 2022 09:38:58 +0000 (11:38 +0200)] 
DOC: quic: Update documentation for QUIC Retry

Add some information for "quic-force-retry" and "tune.quic.retry-force"
settings.

3 years agoMINOR: quic: Transport parameters dump
Frédéric Lécaille [Mon, 23 May 2022 07:08:54 +0000 (09:08 +0200)] 
MINOR: quic: Transport parameters dump

Add quic_transport_params_dump() static inline function to do so for
a quic_transport_parameters struct as parameter.
We use the trace API do dump these transport parameters both
after they have been initialized (RX/local) or received (TX/remote).

3 years agoMINOR: quic: QUIC transport parameters split.
Frédéric Lécaille [Sat, 21 May 2022 21:58:40 +0000 (23:58 +0200)] 
MINOR: quic: QUIC transport parameters split.

Make the transport parameters be standlone as much as possible as
it consists only in encoding/decoding data into/from buffers.
Reduce the size of xprt_quic.h. Unfortunalety, I think we will
have to continue to include <xprt_quic-t.h> to use the trace API
into this module.