]> git.ipfire.org Git - thirdparty/haproxy.git/log
thirdparty/haproxy.git
11 years agoMEDIUM: config: relax use_backend check to make the condition optional
Willy Tarreau [Tue, 22 Apr 2014 23:21:56 +0000 (01:21 +0200)] 
MEDIUM: config: relax use_backend check to make the condition optional

Since it became possible to use log-format expressions in use_backend,
having a mandatory condition becomes annoying because configurations
are full of "if TRUE". Let's relax the check to accept no condition
like many other keywords (eg: redirect).

11 years agoDOC: add pointer to the Cyril's HTML doc in the README
Willy Tarreau [Tue, 22 Apr 2014 22:57:08 +0000 (00:57 +0200)] 
DOC: add pointer to the Cyril's HTML doc in the README

It's a better place for newcomers to start with.

11 years agoBUG/MINOR: stats: last session was not always set
Willy Tarreau [Tue, 22 Apr 2014 22:35:17 +0000 (00:35 +0200)] 
BUG/MINOR: stats: last session was not always set

Cyril Bonté reported that the "lastsess" field of a stats-only backend
was never updated. In fact the same is true for any applet and anything
not a server. Also, lastsess was not updated for a server reusing its
connection for a new request.

Since the goal of this field is to report recent activity, it's better
to ensure that all accesses are reported. The call has been moved to
the code validating the session establishment instead, since everything
passes there.

11 years agoDOC: fix fetching samples syntax
Cyril Bonté [Tue, 22 Apr 2014 21:52:25 +0000 (23:52 +0200)] 
DOC: fix fetching samples syntax

The syntax used to document fetching samples with optional arguments was not
always valid. This commit fixes this issue in order to allow an easier parsing
of the documentation.

11 years agoBUG/MAJOR: http: fix bug in parse_qvalue() when selecting compression algo
Willy Tarreau [Tue, 22 Apr 2014 21:32:05 +0000 (23:32 +0200)] 
BUG/MAJOR: http: fix bug in parse_qvalue() when selecting compression algo

Commit ad90351 ("MINOR: http: Add the "language" converter to for use with accept-language")
introduced a typo in parse_qvalue :

if (*end)
*end = qvalue;

while it should be :

if (end)
*end = qvalue;

Since end is tested for being NULL. This crashes when selecting the
compression algorithm since end is NULL here. No backport is needed,
this is just in latest 1.5-dev.

11 years agoDOC: internal: add some reminders about HTTP parsing and pointer states
Willy Tarreau [Wed, 16 Apr 2014 19:10:49 +0000 (21:10 +0200)] 
DOC: internal: add some reminders about HTTP parsing and pointer states

This is only for development and maintenance.

11 years agoCLEANUP: http: remove all calls to http_silent_debug()
Willy Tarreau [Tue, 22 Apr 2014 06:24:38 +0000 (08:24 +0200)] 
CLEANUP: http: remove all calls to http_silent_debug()

This macro has long remained unused and calls are unevenly spread over
the code, so it's totally useless and pollutes the code. Remove it now.

11 years agoCLEANUP: http: document the response forwarding states
Willy Tarreau [Mon, 21 Apr 2014 09:24:13 +0000 (11:24 +0200)] 
CLEANUP: http: document the response forwarding states

The forwarding code is never obvious to enter into for newcomers, so
better improve the documentation about how states are chained and what
happens for each of them.

11 years agoMAJOR: http: centralize data forwarding in the request path
Willy Tarreau [Tue, 22 Apr 2014 06:19:34 +0000 (08:19 +0200)] 
MAJOR: http: centralize data forwarding in the request path

It is the same principle as what was just done for the response.
It makes the code cleaner, faster, and more maintainable.

11 years agoMEDIUM: http: only allocate the temporary compression buffer when needed
Willy Tarreau [Mon, 21 Apr 2014 09:27:29 +0000 (11:27 +0200)] 
MEDIUM: http: only allocate the temporary compression buffer when needed

Since we know when the buffer is needed, only check for its allocation
at the same place in order to avoid useless tests on the normal path.

11 years agoMINOR: http: further cleanups of response forwarding function
Willy Tarreau [Mon, 21 Apr 2014 08:54:27 +0000 (10:54 +0200)] 
MINOR: http: further cleanups of response forwarding function

There is no reason for mixing compressing and non-compressing
code in the DATA state, they don't share anything. Better make
this clearer.

11 years agoMEDIUM: http: start to centralize the forwarding code
Willy Tarreau [Fri, 18 Apr 2014 07:53:50 +0000 (09:53 +0200)] 
MEDIUM: http: start to centralize the forwarding code

Doing so avoids calling channel_forward() for each part of the chunk
parsing and lowers the number of calls to channel_forward() to only
one per buffer, resulting in about 11% performance increase on small
chunks forwarding rate.

11 years agoMEDIUM: http: cleanup: centralize a little bit HTTP compression end
Willy Tarreau [Thu, 17 Apr 2014 22:53:43 +0000 (00:53 +0200)] 
MEDIUM: http: cleanup: centralize a little bit HTTP compression end

The call to flush the compression buffers only needs to be done when
entering the final states or when leaving with missing data. After
that, if trailers are present, they have to be forwarded.

11 years agoMAJOR: http/compression: fix chunked-encoded response processing
Willy Tarreau [Thu, 17 Apr 2014 22:20:14 +0000 (00:20 +0200)] 
MAJOR: http/compression: fix chunked-encoded response processing

Now we have valid buffer offsets, we can use them to safely parse the
input and only forward when needed. Thus we can get rid of the
consumed_data accumulator, and the code now works both for chunked and
content-length, even with a server feeding one byte at a time (which
systematically broke the previous one).

It's worth noting that 0<CRLF> must always be sent after end of data
(ie: chunk_len==0), and that the trailing CRLF is sent only content
length mode, because in chunked we'll have to pass trailers.

11 years agoMAJOR: http: re-enable compression on chunked encoding
Willy Tarreau [Thu, 17 Apr 2014 19:55:11 +0000 (21:55 +0200)] 
MAJOR: http: re-enable compression on chunked encoding

This is basically a revert of commit 667c2a3 ("BUG/MAJOR: http: compression
still has defects on chunked responses").

The latest changes applied to message pointers should have got rid of all
the issues that were making the compression of partial chunks unreliable.

11 years agoMEDIUM: http: headers must be forwarded even if data was already inspected
Willy Tarreau [Tue, 22 Apr 2014 12:29:58 +0000 (14:29 +0200)] 
MEDIUM: http: headers must be forwarded even if data was already inspected

Currently, we forward headers only if the incoming message is still before
HTTP_MSG_CHUNK_SIZE, otherwise they'll be considered as data. In practice
this is always true for the response since there's no data inspection, and
for the request there is no compression so there's no problem with forwarding
them as data.

But the principle is incorrect and will make it difficult to later add data
processing features. So better fix it now.

The new principle is simple :
  - if headers were not yet forwarded, forward them now.
  - while doing so, check if we need to update the state

11 years agoBUG/MINOR: http: deinitialize compression after a compression error
Willy Tarreau [Tue, 22 Apr 2014 19:22:06 +0000 (21:22 +0200)] 
BUG/MINOR: http: deinitialize compression after a compression error

If for some reason, the compression returns an error, the compression
is not deinitialized which also means that any pending data are not
flushed and could be lost, especially in the chunked-encoded case.
No backport is needed.

11 years agoBUG/MINOR: http: deinitialize compression after a parsing error
Willy Tarreau [Mon, 21 Apr 2014 09:00:13 +0000 (11:00 +0200)] 
BUG/MINOR: http: deinitialize compression after a parsing error

When a parsing error was encountered in a chunked response, we failed
to properly deinitialize the compression context. There was no impact
till now since compression of chunked responses was disabled. No backport
is needed.

11 years agoMEDIUM: http: forward headers again while waiting for connection to complete
Willy Tarreau [Thu, 17 Apr 2014 19:50:00 +0000 (21:50 +0200)] 
MEDIUM: http: forward headers again while waiting for connection to complete

Thanks to the last updates on the message pointers, it is now safe again to
enable forwarding of the request headers while waiting for the connection to
complete because we know how to safely rewind this part.

So this patch slightly modifies what was done in commit 80a92c0 ("BUG/MEDIUM:
http: don't start to forward request data before the connect") to let up to
msg->sov bytes be forwarded when waiting for the connection. The resulting
effect is that a POST request may now be sent with the connect's ACK, which
still saves a packet and may even be useful later when TFO is supported.

11 years agoMAJOR: http: reset msg->sov after headers are forwarded
Willy Tarreau [Thu, 17 Apr 2014 19:14:47 +0000 (21:14 +0200)] 
MAJOR: http: reset msg->sov after headers are forwarded

In order to avoid abusively relying on buf->o to guess how many bytes to
rewind during a redispatch, we now clear msg->sov. Thus the meaning of this
field is exactly "how many bytes of headers are left to be forwarded". It
is still possible to rewind because msg->eoh + msg->eol equal that value
before scheduling the forwarding, so we can always subtract them.

11 years agoMEDIUM: http: small helpers to compute how far to rewind to find BODY and DATA
Willy Tarreau [Thu, 17 Apr 2014 18:31:44 +0000 (20:31 +0200)] 
MEDIUM: http: small helpers to compute how far to rewind to find BODY and DATA

http_body_rewind() returns the number of bytes to rewind before buf->p to
find the message's body. It relies on http_hdr_rewind() to find the beginning
and adds msg->eoh + msg->eol which are always safe.

http_data_rewind() does the same to get the beginning of the data, which
differs from above when a chunk is present. It uses the function above and
adds msg->sol.

The purpose is to centralize further ->sov changes aiming at avoiding
to rely on buf->o.

11 years agoMINOR: http: add a small helper to compute how far to rewind to find URI
Willy Tarreau [Thu, 17 Apr 2014 18:24:24 +0000 (20:24 +0200)] 
MINOR: http: add a small helper to compute how far to rewind to find URI

http_uri_rewind() returns the number of bytes to rewind before buf->p to
find the URI. It relies on http_hdr_rewind() to find the beginning and
is just here to simplify operations.

The purpose is to centralize further ->sov changes aiming at avoiding
to rely on buf->o.

11 years agoMEDIUM: http: add a small helper to compute how far to rewind to find headers
Willy Tarreau [Thu, 17 Apr 2014 18:18:08 +0000 (20:18 +0200)] 
MEDIUM: http: add a small helper to compute how far to rewind to find headers

http_hdr_rewind() returns the number of bytes to rewind before buf->p to
find the beginning of headers. At the moment it's not exact as it still
relies on buf->o, assuming that no other data from a past message were
pending there, but it's what was done till there.

The purpose is to centralize further ->sov changes aiming at avoiding
to rely on buf->o.

11 years agoMINOR: http: add a small helper to compute the amount of body bytes present
Willy Tarreau [Thu, 17 Apr 2014 18:08:17 +0000 (20:08 +0200)] 
MINOR: http: add a small helper to compute the amount of body bytes present

http_body_bytes() returns the number of bytes of the current message body
present in the buffer. It is compatible with being called before and after
the headers are forwarded.

This is done to centralize further ->sov changes.

11 years agoMAJOR: http: don't update msg->sov anymore while processing the body
Willy Tarreau [Thu, 17 Apr 2014 13:21:20 +0000 (15:21 +0200)] 
MAJOR: http: don't update msg->sov anymore while processing the body

We used to have msg->sov updated for every chunk that was parsed. The issue
is that we want to be able to rewind after chunks were parsed in case we need
to redispatch a request and perform a new hash on the request or insert a
different server header name.

Currently, msg->sov and msg->next make parallel progress. We reached a point
where they're always equal because msg->next is initialized from msg->sov,
and is subtracted msg->sov's value each time msg->sov bytes are forwarded.
So we can now ensure that msg->sov can always be replaced by msg->next for
every state after HTTP_MSG_BODY where it is used as a position counter.

This allows us to keep msg->sov untouched whatever the number of chunks that
are parsed, as is needed to extract data from POST request (eg: url_param).
However, we still need to know the starting position of the data relative to
the body, which differs by the chunk size length. We use msg->sol for this
since it's now always zero and unused in the body.

So with this patch, we have the following situation :

 - msg->sov = msg->eoh + msg->eol = size of the headers including last CRLF
 - msg->sol = length of the chunk size if any. So msg->sov + msg->sol = DATA.
 - msg->next corresponds to the byte being inspected based on the current
   state and is always >= msg->sov before starting to forward anything.

Since sov and next are updated in case of header rewriting, a rewind will
fix them both when needed. Of course, ->sol has no reason for changing in
such conditions, so it's fine to keep it relative to msg->sov.

In theory, even if a redispatch has to be performed, a transformation
occurring on the request would still work because the data moved would
still appear at the same place relative to bug->p.

11 years agoMEDIUM: http: http_parse_chunk_crlf() must not advance the buffer pointer
Willy Tarreau [Thu, 17 Apr 2014 09:40:10 +0000 (11:40 +0200)] 
MEDIUM: http: http_parse_chunk_crlf() must not advance the buffer pointer

This function is only a parser, it must start to parse at the next character
and only update the outgoing relative pointers, but not expect the buffer to
be aligned with the next byte to be parsed.

It's important to fix this otherwise we cannot use this function to parse
chunks without starting to forward data.

11 years agoMAJOR: http: do not use msg->sol while processing messages or forwarding data
Willy Tarreau [Sun, 7 Apr 2013 16:48:08 +0000 (18:48 +0200)] 
MAJOR: http: do not use msg->sol while processing messages or forwarding data

There are still some pending issues in the gzip compressor, and fixing
them requires a better handling of intermediate parsing states.

Another issue to deal with is the rewinding of a buffer during a redispatch
when a load balancing algorithm involves L7 data because the exact amount of
data to rewind is not clear. At the moment, this is handled by unwinding all
pending data, which cannot work in responses due to pipelining.

Last, having a first analysis which parses the body and another one which
restarts from where the parsing was left is wrong. Right now it only works
because we never both parse and transform in the same direction. But that
is wrong anyway.

In order to address the first issue, we'll have to use msg->eoh + msg->eol
to find the end of headers, and we still need to store the information about
the forwarded header length somewhere (msg->sol might be reused for this).

msg->sov may only be used for the start of data and not for subsequent chunks
if possible. This first implies that we stop sharing it with header length,
and stop using msg->sol there. In fact we don't need it already as it is
always zero when reaching the HTTP_MSG_BODY state. It was only updated to
reflect a copy of msg->sov.

So now as a first step into that direction, this patch ensure that msg->sol
is never re-assigned after being set to zero and is not used anymore when
we're dealing with HTTP processing and forwarding. We'll later reuse it
differently but for now it's secured.

The patch does nothing magic, it only removes msg->sol everywhere it was
already zero and avoids setting it. In order to keep the sov-sol difference,
it now resets sov after forwarding data. In theory there's no problem here,
but the patch is still tagged major because that code is complex.

11 years agoMINOR: http: make msg->eol carry the last CRLF length
Willy Tarreau [Thu, 13 Mar 2014 14:48:45 +0000 (15:48 +0100)] 
MINOR: http: make msg->eol carry the last CRLF length

One of the issues we face when we need to either forward headers only
before compressing, or rewind the stream during a redispatch is to know
the proper length of the request headers. msg->eoh always has the total
length up to the last CRLF, and we never know whether the request ended
with a single LF or a standard CRLF. This makes it hard to rewind the
headers without explicitly checking the bytes in the buffer.

Instead of doing so, we now use msg->eol to carry the length of the last
CRLF (either 1 or 2). Since it is not modified at all after HTTP_MSG_BODY,
and was only left in an undefined state, it is safe to use at any moment.

Thus, the complete header length to forward or to rewind now is always
msg->eoh + msg->eol.

11 years agoCLEANUP: http: prepare dedicated processing for chunked encoded message bodies
Willy Tarreau [Thu, 10 Apr 2014 09:59:33 +0000 (11:59 +0200)] 
CLEANUP: http: prepare dedicated processing for chunked encoded message bodies

Content-length encoded message bodies are trivial to deal with, but
chunked-encoded will require improvements, so let's separate the code
flows between the two to ease next steps. The behaviour is not changed
at all, the code is only rearranged.

11 years agoCLEANUP: http: rename http_process_request_body()
Willy Tarreau [Thu, 10 Apr 2014 09:16:06 +0000 (11:16 +0200)] 
CLEANUP: http: rename http_process_request_body()

This function does not process anything, it just waits for the beginning
of the request body. Let's rename it http_wait_for_request_body().

11 years agoMEDIUM: http: wait for the first chunk or message body length in http_process_body
Willy Tarreau [Thu, 10 Apr 2014 09:55:45 +0000 (11:55 +0200)] 
MEDIUM: http: wait for the first chunk or message body length in http_process_body

This is the continuation of previous patch. Now that full buffers are
not rejected anymore, let's wait for at least the advertised chunk or
body length to be present or the buffer to be full. When either
condition is met, the message processing can go forward.

Thus we don't need to use url_param_post_limit anymore, which was passed
in the configuration as an optionnal <max_wait> parameter after the
"check_post" value. This setting was necessary when the feature was
implemented because there was no support for parsing message bodies.

The argument is now silently ignored if set in the configuration.

11 years agoMEDIUM: http: don't reject anymore message bodies not containing the url param
Willy Tarreau [Thu, 10 Apr 2014 09:50:37 +0000 (11:50 +0200)] 
MEDIUM: http: don't reject anymore message bodies not containing the url param

http_process_request_body() currently expects a request body containing
exactly an expected message body. This was done in order to support load
balancing on a unique POST parameter but the way it's done still suffers
from some limitations. One of them is that there is no guarantee that the
accepted message will contain the appropriate string if it starts with
another parameter. But at the same time it will reject a message when the
buffer is full.

So as a first step, we don't reject anymore message bodies that fill the
buffer.

11 years agoMINOR: http: add the function "del-header" to the directives http-request and http...
Thierry FOURNIER [Tue, 22 Apr 2014 16:07:25 +0000 (18:07 +0200)] 
MINOR: http: add the function "del-header" to the directives http-request and http-response

This patch permits to remove all HTTP request and response header fields
whose name is specified in <name>.

11 years agoCLEANUP: code style: use tabs to indent codes instead of spaces
Godbach [Mon, 21 Apr 2014 13:52:23 +0000 (21:52 +0800)] 
CLEANUP: code style: use tabs to indent codes instead of spaces

Signed-off-by: Godbach <nylzhaowei@gmail.com>
11 years agoDOC: fix typo
Godbach [Mon, 21 Apr 2014 13:42:41 +0000 (21:42 +0800)] 
DOC: fix typo

"a intermediate CA" => "an intermediate CA"

Signed-off-by: Godbach <nylzhaowei@gmail.com>
11 years agoMINOR: systemd wrapper: propagate exit status
Apollon Oikonomopoulos [Thu, 17 Apr 2014 13:39:30 +0000 (16:39 +0300)] 
MINOR: systemd wrapper: propagate exit status

Use HAProxy's exit status as the systemd wrapper's exit status instead
of always returning EXIT_SUCCESS, permitting the use of systemd's
`Restart = on-failure' logic.

11 years agoMINOR: systemd wrapper: improve logging
Apollon Oikonomopoulos [Thu, 17 Apr 2014 13:39:29 +0000 (16:39 +0300)] 
MINOR: systemd wrapper: improve logging

Use standard error for logging messages, as it seems that this gets
messages to the systemd journal more reliably. Also use systemd's
support for specifying log levels via stderr to apply different levels
to messages.

11 years agoMINOR: systemd wrapper: re-execute on SIGUSR2
Apollon Oikonomopoulos [Thu, 17 Apr 2014 13:39:28 +0000 (16:39 +0300)] 
MINOR: systemd wrapper: re-execute on SIGUSR2

Re-execute the systemd wrapper on SIGUSR2 and before reloading HAProxy,
making it possible to load a completely new version of HAProxy
(including a new version of the systemd wrapper) gracefully.
Since the wrapper accepts no command-line arguments of its own,
re-execution is signaled using the HAPROXY_SYSTEMD_REEXEC environment
variable.

This is primarily intended to help seamless upgrades of distribution
packages.

11 years agoDOC: Update "language" documentation
Thierry FOURNIER [Wed, 16 Apr 2014 09:10:53 +0000 (11:10 +0200)] 
DOC: Update "language" documentation

The example provided with the "language" filter documentation
doesn' run because the match method is not specified.

11 years agoBUG/MAJOR: session: fix a possible crash with src_tracked
Thierry FOURNIER [Mon, 14 Apr 2014 23:15:52 +0000 (01:15 +0200)] 
BUG/MAJOR: session: fix a possible crash with src_tracked

Since commit 4d4149c ("MEDIUM: counters: support passing the counter
number as a fetch argument"), the sample fetch sc_tracked(num) became
equivalent to sc[0-9]_tracked, by using the same smp_fetch_sc_tracked()
function.

This was theorically made possible after the series of changes starting
with commit a65536ca ("MINOR: counters: provide a generic function to
retrieve a stkctr for sc* and src."). Unfortunately, while all other
functions were changed to use the generic primitive smp_fetch_sc_stkctr(),
smp_fetch_sc_tracked() was forgotten and is not able to differentiate
between sc_tracked, src_tracked and sc[0-9]_tracked. The resulting mess is
that if sc_tracked is used, the counter number is assumed to be 47 because
that's what remains after subtracting "0" from char "_".

Fix this by simply relying on the generic function as should have been
done. The bug was introduced in 1.5-dev20. No backport is needed.

11 years agoBUG/MINOR: log: Don't dump empty unique-id
Thierry FOURNIER [Mon, 14 Apr 2014 23:38:48 +0000 (01:38 +0200)] 
BUG/MINOR: log: Don't dump empty unique-id

If the unique-id value is missing, the build_logline() function dump
anything. It is because the function lf_text() is bypassed. This
function is responsible to dump '-' is the value is not present, and set
the '"' around the value displayed.

This fixes the bug reported by Julient Vehent

11 years agoMINOR: http: Add the "language" converter to for use with accept-language
Thierry FOURNIER [Fri, 11 Apr 2014 15:51:01 +0000 (17:51 +0200)] 
MINOR: http: Add the "language" converter to for use with accept-language

language(<value[;value[;value[;...]]]>[,<default>])

 Returns the value with the highest q-factor from a list as
 extracted from the "accept-language" header using "req.fhdr".
 Values with no q-factor have a q-factor of 1. Values with a
 q-factor of 0 are dropped. Only values which belong to the
 list of semi-colon delimited <values> will be considered. If
 no value matches the given list and a default value is
 provided, it is returned. Note that language names may have
 a variant after a dash ('-'). If this variant is present in
 the list, it will be matched, but if it is not, only the base
 language is checked. The match is case-sensitive, and the
 output string is always one of those provided in arguments.
 The ordering of arguments is meaningless, only the ordering
 of the values in the request counts, as the first value among
 multiple sharing the same q-factor is used.

 Example :

     # this configuration switches to the backend matching a
     # given language based on the request :

     acl de req.fhdr(accept-language),language(de;es;fr;en) de
     acl es req.fhdr(accept-language),language(de;es;fr;en) es
     acl fr req.fhdr(accept-language),language(de;es;fr;en) fr
     acl en req.fhdr(accept-language),language(de;es;fr;en) en
     use_backend german  if de
     use_backend spanish if es
     use_backend french  if fr
     use_backend english if en
     default_backend choose_your_language

11 years agoBUG/MEDIUM: stick-table: fix IPv4-to-IPv6 conversion in src_* fetches
Thierry FOURNIER [Mon, 14 Apr 2014 12:35:40 +0000 (14:35 +0200)] 
BUG/MEDIUM: stick-table: fix IPv4-to-IPv6 conversion in src_* fetches

The function addr_to_stktable_key doesn't consider the expected
type of key. If the stick table key is based on IPv6 addresses
and the input is IPv4, the returned key is IPv4 adddress and his
length is 4 bytes, while is expected 16 bytes key.

This patch considers the expected key and try to convert IPv4 to
IPv6 and IPv6 to IPv4 according with the expected key.

This fixes the bug reported by Apollon Oikonomopoulos.

This bug was introduced somewhere in the 1.5-dev process.

11 years agoBUILD/MINOR: ssl: remove one call to sprintf()
Willy Tarreau [Mon, 14 Apr 2014 16:05:41 +0000 (18:05 +0200)] 
BUILD/MINOR: ssl: remove one call to sprintf()

Lukas reported another OpenBSD complaint about this use of sprintf() that
I missed :

src/ssl_sock.o(.text+0x2a79): In function `bind_parse_crt':
src/ssl_sock.c:3015: warning: sprintf() is often misused, please use snprintf()

This one was even easier to handle. Note that some of these calls could
be simplified by checking the snprintf output size instead of doing the
preliminary size computation.

11 years agoMEDIUM: ssl: Add standardized DH parameters >= 1024 bits
Remi Gacogne [Mon, 14 Apr 2014 14:47:31 +0000 (16:47 +0200)] 
MEDIUM: ssl: Add standardized DH parameters >= 1024 bits

This patch adds standardized (rfc 2409 / rfc 3526)
DH parameters with prime lengths of 1024, 2048, 3072, 4096, 6144 and
8192 bits, based on the private key size.

11 years agoBUG/MINOR: Fix name lookup ordering when compiled with USE_GETADDRINFO
Nenad Merdanovic [Mon, 14 Apr 2014 13:56:58 +0000 (15:56 +0200)] 
BUG/MINOR: Fix name lookup ordering when compiled with USE_GETADDRINFO

When compiled with USE_GETADDRINFO, make sure we use getaddrinfo(3) to
perform name lookups. On default dual-stack setups this will change the
behavior of using IPv6 first. Global configuration option
'nogetaddrinfo' can be used to revert to deprecated gethostbyname(3).

11 years agoBUG/MINOR: build: handle whitespaces in wc -l output
Lukas Tribus [Mon, 14 Apr 2014 13:38:26 +0000 (15:38 +0200)] 
BUG/MINOR: build: handle whitespaces in wc -l output

Certain implementations (for example ksh/OpenBSD) prefix the
'wc -l' output with whitespaces. This breaks the build since
689e4d733 ("BUILD: simplify the date and version retrieval in
the makefile").

Fix this by piping the wc output into tr -dc '0-9'.

Workaround is to build with IGNOREGIT=1.

HAProxy-1.4 is affected as well.

11 years agoBUG/MEDIUM: systemd-wrapper: fix locating of haproxy binary
Willy Tarreau [Mon, 14 Apr 2014 13:34:34 +0000 (15:34 +0200)] 
BUG/MEDIUM: systemd-wrapper: fix locating of haproxy binary

OpenBSD complains this way due to strncat() :

src/haproxy-systemd-wrapper.o(.text+0xd5): In function `spawn_haproxy':
src/haproxy-systemd-wrapper.c:33: warning: strcat() is almost always misused, please use strlcat()

In fact, the code before strncat() here is wrong, because it may
dereference a NULL if /proc/self/exe is not readable. So fix it
and get rid of strncat() at the same time.

No backport is needed.

11 years agoBUILD/MEDIUM: http: remove calls to sprintf()
Willy Tarreau [Mon, 14 Apr 2014 13:27:14 +0000 (15:27 +0200)] 
BUILD/MEDIUM: http: remove calls to sprintf()

OpenBSD complains about this use of sprintf() :

src/proto_http.o(.text+0xb0e6): In function `http_process_request':
src/proto_http.c:4127: warning: sprintf() is often misused, please use snprintf()

Here there's no risk as the strings are way shorter than the buffer size
but let's fix it anyway.

11 years agoBUILD/MEDIUM: checks: get rid of sprintf()
Willy Tarreau [Mon, 14 Apr 2014 13:04:54 +0000 (15:04 +0200)] 
BUILD/MEDIUM: checks: get rid of sprintf()

OpenBSD complains about our use of sprintf() here :

src/checks.o(.text+0x44db): In function `process_chk':
src/checks.c:766: warning: sprintf() is often misused, please use snprintf()

This case was not really clean since the introduction of global.node BTW.
Better change the API to support a size argument in the function and enforce
the limit.

11 years agoBUILD/MEDIUM: cfgparse: get rid of sprintf()
Willy Tarreau [Mon, 14 Apr 2014 13:00:39 +0000 (15:00 +0200)] 
BUILD/MEDIUM: cfgparse: get rid of sprintf()

A few occurrences of sprintf() were causing harmless warnings on OpenBSD :

src/cfgparse.o(.text+0x259e): In function `cfg_parse_global':
src/cfgparse.c:1044: warning: sprintf() is often misused, please use snprintf()

These ones were easy to get rid of, so better do it.

11 years agoBUILD/MEDIUM: standard: get rid of sprintf()
Willy Tarreau [Mon, 14 Apr 2014 12:53:06 +0000 (14:53 +0200)] 
BUILD/MEDIUM: standard: get rid of sprintf()

OpenBSD complains about the use of sprintf in human_time() :

src/standard.o(.text+0x1c40): In function `human_time':
src/standard.c:2067: warning: sprintf() is often misused, please use snprintf()

We can easily get around this by having a pointer to the end of the string and
using snprintf() instead.

11 years agoBUILD/MEDIUM: standard: get rid of the last strcpy()
Willy Tarreau [Mon, 14 Apr 2014 12:49:00 +0000 (14:49 +0200)] 
BUILD/MEDIUM: standard: get rid of the last strcpy()

OpenBSD complains about our use of strcpy() in standard.c. The checks
were OK and we didn't fall into the category of "almost always misused",
but it's very simple to fix it so better do it before a problem happens.

src/standard.o(.text+0x26ab): In function `str2sa_range':
src/standard.c:718: warning: strcpy() is almost always misused, please use strlcpy()

11 years agoDOC: fix a few config typos.
Jarno Huuskonen [Sat, 12 Apr 2014 15:22:19 +0000 (18:22 +0300)] 
DOC: fix a few config typos.

Here's a small patch that fixes a few typos in
configuration.txt (and one in haproxy.1).

11 years agoBUG/MINOR: build: add missing objects in osx and bsd Makefiles
Lukas Tribus [Sat, 12 Apr 2014 16:41:02 +0000 (18:41 +0200)] 
BUG/MINOR: build: add missing objects in osx and bsd Makefiles

Commits 98634f0c7b8ed66c297c26 and d5f624dde78 updated the main
makefile with new objects src/hash.o, src/pattern.o and src/map.o,
but missed to update Makefile.bsd and Makefile.osx.

This will fix some of the build failures reported by Jorge Severino
under OpenBSD.

11 years agoBUG/MINOR: acl: req_ssl_sni fails with SSLv3 record version
Lukas Tribus [Thu, 10 Apr 2014 19:36:22 +0000 (21:36 +0200)] 
BUG/MINOR: acl: req_ssl_sni fails with SSLv3 record version

SNI is a TLS extension and requires at least TLSv1.0 or later, however
the version in the record layer may be SSLv3, not necessarily TLSv1.0.

GnuTLS for example does this.

Relax the record layer version check in smp_fetch_ssl_hello_sni() to
allow fetching SNI values from clients indicating SSLv3 in the record
layer (maintaining the TLSv1.0+ check in the actual handshake version).

This was reported and analyzed by Pravin Tatti.

11 years agoBUILD: ssl: previous patch failed
Willy Tarreau [Wed, 9 Apr 2014 13:40:42 +0000 (15:40 +0200)] 
BUILD: ssl: previous patch failed

This is a minor error, s/SMP_T_CSTR/SMP_T_STR + SMP_F_CONST.

11 years agoMINOR: ssl: add ssl_fc_unique_id to fetch TLS Unique ID
David S [Tue, 8 Apr 2014 22:48:47 +0000 (18:48 -0400)] 
MINOR: ssl: add ssl_fc_unique_id to fetch TLS Unique ID

The TLS unique id, or unique channel binding, is a byte string that can be
pulled from a TLS connection and it is unique to that connection. It is
defined in RFC 5929 section 3.  The value is used by various upper layer
protocols as part of an extra layer of security.  For example XMPP
(RFC 6120) and EST (RFC 7030).

Add the ssl_fc_unique_id keyword and corresponding sample fetch method.
Value is retrieved from OpenSSL and base64 encoded as described in RFC
5929 section 3.

11 years agoBUG/MAJOR: counters: check for null-deref when looking up an alternate table
Willy Tarreau [Wed, 9 Apr 2014 11:25:42 +0000 (13:25 +0200)] 
BUG/MAJOR: counters: check for null-deref when looking up an alternate table

Constructions such as sc0_get_gpc0(foo) allow to look up the same key as
the current key but in an alternate table. A check was missing to ensure
we already have a key, resulting in a crash if this lookup is performed
before the associated track-sc rule.

This bug was reported on the mailing list by Neil@iamafreeman and
narrowed down further by Lukas Tribus and Thierry Fournier.

This bug was introduced in 1.5-dev20 by commit "0f791d4 MEDIUM: counters:
support looking up a key in an alternate table".

11 years agoBUG/MINOR: reject malformed HTTP/0.9 requests
Apollon Oikonomopoulos [Sat, 5 Apr 2014 23:46:00 +0000 (02:46 +0300)] 
BUG/MINOR: reject malformed HTTP/0.9 requests

RFC 1945 (§4.1) defines an HTTP/0.9 request ("Simple-Request") as:

  Simple-Request  = "GET" SP Request-URI CRLF

HAProxy tries to automatically upgrade HTTP/0.9 requests to
to HTTP/1.0, by appending "HTTP/1.0" to the request and setting the
Request-URI to "/" if it was not present. The latter however is
RFC-incompatible, as HTTP/0.9 requests must already have a Request-URI
according to the definition above. Additionally,
http_upgrade_v09_to_v10() does not check whether the request method is
indeed GET (the mandatory method for HTTP/0.9).

As a result, any single- or double-word request line is regarded as a
valid HTTP request. We fix this by failing in http_upgrade_v09_to_v10()
if the request method is not GET or the request URI is not present.

11 years agoCLEANUP: pattern: move array definitions to proto/ and not types/
Willy Tarreau [Wed, 2 Apr 2014 18:55:23 +0000 (20:55 +0200)] 
CLEANUP: pattern: move array definitions to proto/ and not types/

All symbol definitions should be in proto/ and not types/.

11 years agoBUG/MEDIUM: pattern: fix wrong definition of the pat_prune_fcts array
Willy Tarreau [Wed, 2 Apr 2014 18:51:04 +0000 (20:51 +0200)] 
BUG/MEDIUM: pattern: fix wrong definition of the pat_prune_fcts array

Commit 6f7203d ("MEDIUM: pattern: add prune function") introduced an
array of functions pat_prune_fcts[] but unfortunately declared it in
pattern.h without marking it "extern", resulting in each file including
it having its own copy.

11 years agoBUILD: adjust makefile for AIX 5.1
Willy Tarreau [Wed, 2 Apr 2014 18:44:43 +0000 (20:44 +0200)] 
BUILD: adjust makefile for AIX 5.1

AIX 5.1 has trouble with ss_family which is __ss_family there.
Just remap it in the makefile and provide a new target.

11 years agoREORG: cfgparse: move server keyword parsing to server.c
Willy Tarreau [Mon, 31 Mar 2014 08:39:59 +0000 (10:39 +0200)] 
REORG: cfgparse: move server keyword parsing to server.c

The cfgparse.c file becomes huge, and a large part of it comes from the
server keyword parser. Since the configuration is a bit more modular now,
move this parser to server.c.

This patch also moves the check of the "server" keyword earlier in the
supported keywords list, resulting in a slightly faster config parsing
for configs with large numbers of servers (about 10%).

No functional change was made, only the code was moved.

11 years agoMEDIUM: proxy: support use_backend with dynamic names
Bertrand Jacquin [Tue, 19 Nov 2013 10:43:06 +0000 (11:43 +0100)] 
MEDIUM: proxy: support use_backend with dynamic names

We have a use case where we look up a customer ID in an HTTP header
and direct it to the corresponding server. This can easily be done
using ACLs and use_backend rules, but the configuration becomes
painful to maintain when the number of customers grows to a few
tens or even a several hundreds.

We realized it would be nice if we could make the use_backend
resolve its name at run time instead of config parsing time, and
use a similar expression as http-request add-header to decide on
the proper backend to use. This permits the use of prefixes or
even complex names in backend expressions. If no name matches,
then the default backend is used. Doing so allowed us to get rid
of all the use_backend rules.

Since there are some config checks on the use_backend rules to see
if the referenced backend exists, we want to keep them to detect
config errors in normal config. So this patch does not modify the
default behaviour and proceeds this way :

  - if the backend name in the use_backend directive parses as a log
    format rule, it's used as-is and is resolved at run time ;

  - otherwise it's a static name which must be valid at config time.

There was the possibility of doing this with the use-server directive
instead of use_backend, but it seems like use_backend is more suited
to this task, as it can be used for other purposes. For example, it
becomes easy to serve a customer-specific proxy.pac file based on the
customer ID by abusing the errorfile primitive :

     use_backend bk_cust_%[hdr(X-Cust-Id)] if { hdr(X-Cust-Id) -m found }
     default_backend bk_err_404

     backend bk_cust_1
         errorfile 200 /etc/haproxy/static/proxy.pac.cust1

Signed-off-by: Bertrand Jacquin <bjacquin@exosec.fr>
11 years agoMEDIUM: config: Dynamic sections.
Thierry FOURNIER [Tue, 18 Mar 2014 12:54:18 +0000 (13:54 +0100)] 
MEDIUM: config: Dynamic sections.

This patch permit to register new sections in the haproxy's
configuration file. This run like all the "keyword" registration, it is
used during the haproxy initialization, typically with the
"__attribute__((constructor))" functions.

11 years agoMINOR: standard: Add ipv6 support in the function url2sa().
Thierry FOURNIER [Fri, 21 Mar 2014 13:51:46 +0000 (14:51 +0100)] 
MINOR: standard: Add ipv6 support in the function url2sa().

The function url2sa() converts faster url like http://<ip>:<port> in a
struct sockaddr_storage. This patch add:
 - the https support
 - permit to return the length parsed
 - support IPv6
 - support DNS synchronous resolution only during start of haproxy.

The faster IPv4 convertion way is keeped. IPv6 is slower, because I use
the standard IPv6 parser function.

11 years agoMINOR: pattern: Add function to prune and reload pattern list.
Thierry FOURNIER [Fri, 21 Mar 2014 20:45:15 +0000 (21:45 +0100)] 
MINOR: pattern: Add function to prune and reload pattern list.

This function it is used for dynamically update all the patterns
attached to one file. This function is atomic. All parsing or indexation
failures are reported in the haproxy logs.

11 years agoMINOR: session: don't always assume there's a listener
Thierry FOURNIER [Thu, 20 Mar 2014 14:42:53 +0000 (15:42 +0100)] 
MINOR: session: don't always assume there's a listener

For outgoing connections initiated from an applet, there might not be
any listener. It's the case with peers, which resort to a hack consisting
in making the session's listener point to the peer. This listener is only
used for statistics now so it's much easier to check for its presence now.

11 years agoMINOR: cli: remove information about acl or map owner.
Thierry FOURNIER [Thu, 20 Mar 2014 10:45:47 +0000 (11:45 +0100)] 
MINOR: cli: remove information about acl or map owner.

The string <display> contain all the owners of the displayed pattern.
The message " - also used by an ACL/map" is useless.

11 years agoMINOR: pattern/cli: Update used terms in documentation and cli
Thierry FOURNIER [Thu, 20 Mar 2014 10:42:45 +0000 (11:42 +0100)] 
MINOR: pattern/cli: Update used terms in documentation and cli

This patch replace the word <name> by the word <file>. This word defines
the (string) returned by show "map/acl". This patch also update
documentation to explain how is composed the map or acl identifier.

11 years agoDOC: pattern: pattern organisation schematics
Thierry FOURNIER [Thu, 20 Mar 2014 10:25:28 +0000 (11:25 +0100)] 
DOC: pattern: pattern organisation schematics

11 years agoMEDIUM: compression: consider the "q=" attribute in Accept-Encoding
Willy Tarreau [Wed, 19 Mar 2014 11:07:52 +0000 (12:07 +0100)] 
MEDIUM: compression: consider the "q=" attribute in Accept-Encoding

Till now we didn't consider "q=". It's problematic because the first
effect is that compression tokens were not even matched if it was
present.

It is important to parse it correctly because we still want to allow
a user-agent to send "q=0" to explicitly disable a compressor, or to
specify its preferences.

Now, q-values are respected in order of precedence, and when several
q-values are equal, the first occurrence is used.

11 years agoDOC: lowercase format string in unique-id
Julien Vehent [Fri, 7 Mar 2014 13:27:34 +0000 (08:27 -0500)] 
DOC: lowercase format string in unique-id

Update configuration.txt to use the correct format string in the
unique-id documentation.

11 years agoBUG/MEDIUM: acl: boolean only matches were broken by recent changes
Thierry FOURNIER [Mon, 17 Mar 2014 18:53:10 +0000 (19:53 +0100)] 
BUG/MEDIUM: acl: boolean only matches were broken by recent changes

The ACL changes made in the last patchset force the execution
of each pattern matching function. The function pat_match_nothing
was not provided to be excuted, it was just used as a flag that
was checked by the ACL execution code. Now this function is
executed and always returns false.

This patch makes it work as expected. Now, it returns the boolean
status of the received sample just as was done previously in the
ACL code.

This bug is a part of the patchset just merged. It does not need
to be backported.

11 years agoMEDIUM: acl: Change the acl register struct
Thierry FOURNIER [Wed, 5 Mar 2014 15:07:08 +0000 (16:07 +0100)] 
MEDIUM: acl: Change the acl register struct

This patch replace a lot of pointeur by pattern matching identifier. If
the declared ACL use all the predefined pattern matching functions, the
register function gets the functions provided by "pattern.c" and
identified by the PAT_LATCH_*.

In the case of the acl uses his own functions, they can be declared, and
the acl registration doesn't change it.

11 years agoDOC: document "get map" / "get acl" on the CLI
Thierry FOURNIER [Wed, 26 Feb 2014 17:07:38 +0000 (18:07 +0100)] 
DOC: document "get map" / "get acl" on the CLI

11 years agoMINOR: pattern: forbid dns resolutions
Thierry FOURNIER [Tue, 11 Feb 2014 15:24:41 +0000 (16:24 +0100)] 
MINOR: pattern: forbid dns resolutions

This patch adds the flags "-n" on the acl parser. the flag "-n" forbif
the DNS resolutions. The maps have always the dns resolutions disabled.

11 years agoMINOR: pattern: Remove the flag "PAT_F_FROM_FILE".
Thierry FOURNIER [Tue, 11 Feb 2014 15:19:46 +0000 (16:19 +0100)] 
MINOR: pattern: Remove the flag "PAT_F_FROM_FILE".

This flag is no longer used. The last place using this, are the display
of the result of pattern matching in the cli command "get map" or "get
acl".

The first parameter of this command is the reference of the file used to
perform the lookup.

11 years agoMINOR: standard: Disable ip resolution during the runtime
Thierry FOURNIER [Tue, 11 Feb 2014 14:23:04 +0000 (15:23 +0100)] 
MINOR: standard: Disable ip resolution during the runtime

The function str2net runs DNS resolution if valid ip cannot be parsed.
The DNS function used is the standard function of the libc and it
performs asynchronous request.

The asynchronous request is not compatible with the haproxy
archictecture.

str2net() is used during the runtime throught the "socket".

This patch remove the DNS resolution during the runtime.

11 years agoMINOR: dumpstat/conf: display all the configuration lines that using pattern reference
Thierry FOURNIER [Tue, 11 Feb 2014 13:36:45 +0000 (14:36 +0100)] 
MINOR: dumpstat/conf: display all the configuration lines that using pattern reference

11 years agoMINOR: configuration: File and line propagation
Thierry FOURNIER [Tue, 11 Feb 2014 13:00:19 +0000 (14:00 +0100)] 
MINOR: configuration: File and line propagation

This patch permits to communicate file and line of the
configuration file at the configuration parser.

11 years agoMINOR: pattern: index duplicates
Thierry FOURNIER [Wed, 29 Jan 2014 23:27:15 +0000 (00:27 +0100)] 
MINOR: pattern: index duplicates

The indexation functions now accept duplicates. This way it is possible
to always have some consistency between lists and trees. The "add" command
will always add regardless of any previous existence. The new entry will
not be used because both trees and list retrieve keys in insertion order.
Thus the "add" operation will always succeed (as long as there is enough
memory).

11 years agoMINOR: doc: Update the documentation about the map and acl
Thierry FOURNIER [Wed, 29 Jan 2014 19:02:04 +0000 (20:02 +0100)] 
MINOR: doc: Update the documentation about the map and acl

Documentation about the socket command line new commands and new behavior.

11 years agoMINOR: cli: Block the usage of the command "acl add" in many cases.
Thierry FOURNIER [Wed, 29 Jan 2014 19:02:36 +0000 (20:02 +0100)] 
MINOR: cli: Block the usage of the command "acl add" in many cases.

If acl is shared with a map, the "add acl" command must be blocked
because it not take a sample on his parameters. The absense of this
parameter can cause error with corresponding maps.

11 years agoMINOR: regex: The pointer regstr in the struc regex is no longer used.
Thierry FOURNIER [Wed, 29 Jan 2014 18:35:16 +0000 (19:35 +0100)] 
MINOR: regex: The pointer regstr in the struc regex is no longer used.

The pointer <regstr> is only used to compare and identify the original
regex string with the patterns. Now the patterns have a reference map
containing this original string. It is useless to store this value two
times.

11 years agoMINOR: pattern: The function pat_ref_set() have now atomic behavior
Thierry FOURNIER [Wed, 29 Jan 2014 18:35:06 +0000 (19:35 +0100)] 
MINOR: pattern: The function pat_ref_set() have now atomic behavior

Before this patch, this function try to add values in best effort. If
the parsing iof the value fail, the operation continue until the end.

Now, this function stop on the first error and left the pattern in
coherant state.

11 years agoMEDIUM: dumpstats: Display error message during add of values.
Thierry FOURNIER [Wed, 29 Jan 2014 18:08:49 +0000 (19:08 +0100)] 
MEDIUM: dumpstats: Display error message during add of values.

This patch adds new display type. This display returns allocated string,
when the string is flush into buffers, it is freed. This permit to
return the content of "memprintf(err, ...)" messages.

The pat_ref_add functions has changed to return error.

11 years agoMINOR: acl/pattern: Acl "-M" option force to load file as map file with two columns
Thierry FOURNIER [Wed, 29 Jan 2014 13:23:29 +0000 (14:23 +0100)] 
MINOR: acl/pattern: Acl "-M" option force to load file as map file with two columns

11 years agoMINOR: pattern: Check if the file reference is not used with acl and map
Thierry FOURNIER [Wed, 29 Jan 2014 11:32:58 +0000 (12:32 +0100)] 
MINOR: pattern: Check if the file reference is not used with acl and map

The format of the acl file are not the same than the format of the map
files. In some case, the same file can be used, but this is ambiguous
for the user because the patterns are not the expected.

11 years agoMINOR: pattern/map/acl: Centralization of the file parsers
Thierry FOURNIER [Wed, 29 Jan 2014 12:29:45 +0000 (13:29 +0100)] 
MINOR: pattern/map/acl: Centralization of the file parsers

The acl and map function do the same work with the file parsing. This
patch merge these code in only one.

Note that the function map_read_entries_from_file() in the file "map.c"
is moved to the the function pat_ref_read_from_file_smp() in the file
"pattern.c". The code of this function is not modified, only the the
name and the arguments order has changed.

11 years agoMEDIUM: dumpstats/pattern: display and use each pointer of each pattern dumped
Thierry FOURNIER [Tue, 28 Jan 2014 14:55:37 +0000 (15:55 +0100)] 
MEDIUM: dumpstats/pattern: display and use each pointer of each pattern dumped

Each pattern displayed is associated to the value of his pattern
reference. This value can be used for deleting the entry. It is useful
with complex regex: the users are not forced to write the regex with all
the amiguous chars and escaped chars on the CLI.

11 years agoMEDIUM: pattern_find_smp: functions find_smp uses the pat_ref_elt to find the element...
Thierry FOURNIER [Wed, 29 Jan 2014 15:24:55 +0000 (16:24 +0100)] 
MEDIUM: pattern_find_smp: functions find_smp uses the pat_ref_elt to find the element to be removed

The find_smp search the smp using the value of the pat_ref_elt pointer.

The pat_find_smp_* are no longer used. The function pattern_find_smp()
known all pattern indexation, and can be found

11 years agoMEDIUM: pattern: delete() function uses the pat_ref_elt to find the element to be...
Thierry FOURNIER [Tue, 28 Jan 2014 15:43:36 +0000 (16:43 +0100)] 
MEDIUM: pattern: delete() function uses the pat_ref_elt to find the element to be removed

All the pattern delete function can use her reference to the original
"struct pat_ref_elt" to find the element to be remove. The functions
pat_del_list_str() and pat_del_meth() were deleted because after
applying this modification, they have the same code than pat_del_list_ptr().

11 years agoMINOR: dumpstats: display the reference for th key/pattern and value.
Thierry FOURNIER [Tue, 11 Mar 2014 17:37:58 +0000 (18:37 +0100)] 
MINOR: dumpstats: display the reference for th key/pattern and value.

Before this patch, the "get map/acl" function try to convert and display
the sample. This behavior is not efficient because some type like the
regex cannot be reversed and displayed as string.

This patch display the original stored reference.

11 years agoMINOR: pattern: Each pattern expression element store the reference struct.
Thierry FOURNIER [Tue, 28 Jan 2014 14:54:36 +0000 (15:54 +0100)] 
MINOR: pattern: Each pattern expression element store the reference struct.

Now, each pattern entry known the original "struct pat_ref_elt" from
that was built. This patch permit to delete each pattern entry without
confusion. After this patch, each reference can use his pointer to be
targeted.

11 years agoMINOR: pattern: store configuration reference for each acl or map pattern.
Thierry FOURNIER [Tue, 11 Feb 2014 02:31:34 +0000 (03:31 +0100)] 
MINOR: pattern: store configuration reference for each acl or map pattern.

This patch permit to add reference for each pattern reference. This is
useful to identify the acl listed.

11 years agoMINOR: pattern: Merge function pattern_add() with pat_ref_push().
Thierry FOURNIER [Tue, 28 Jan 2014 14:34:35 +0000 (15:34 +0100)] 
MINOR: pattern: Merge function pattern_add() with pat_ref_push().

The function Pattern_add() is only used by pat_ref_push(). This patch
remove the function pattern_add() and merge his code in the function
pat_ref_push().

11 years agoMINOR: pattern: The function "pattern_register()" is no longer used.
Thierry FOURNIER [Mon, 27 Jan 2014 16:20:07 +0000 (17:20 +0100)] 
MINOR: pattern: The function "pattern_register()" is no longer used.

Remove the function "pattern_register()" and its prototype because it
is no longer used.

11 years agoMINOR: pattern/acl: Each pattern of each acl can be load with specified id
Thierry FOURNIER [Mon, 20 Jan 2014 16:01:44 +0000 (17:01 +0100)] 
MINOR: pattern/acl: Each pattern of each acl can be load with specified id

This patch adds -u option on the acl pattern loading to force a unique ID
value.