Age | Commit message (Collapse) | Author |
|
Move challenge computation out of tunnel allocation by using a
generic CHAP-MD5 calculation function. This will allow to initiate
tunnels on the host side (i.e. sending SCCRQ) and to compute the
challenge response later on, when handling the peer response (i.e.
during SCCRP handling).
Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
|
|
Use a "struct sockaddr_in" pointer for passing the peer address to the
tunnel allocation function (instead of a "struct l2tp_packet_t *"). This
makes l2tp_tunnel_alloc() usable in situations where tunnel creation
doesn't happen in response to a peer request.
Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
|
|
The "recv <SCCRQ packet>" message printing should logically belong to
the SCCRQ message reception function. This patch moves this message
from l2tp_tunnel_alloc() to l2tp_recv_SCCRQ() in order to make
l2tp_tunnel_alloc() usable in situations different than SCCRQ
message handling.
Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
|
|
Pass the host address as a directly usable sockaddr_in in
l2tp_tunnel_alloc(), instead of an in_pktinfo. This will allow to
allocate tunnels without having to artificially create in_pktinfo
structures in situations where the tunnel is not created in response
to an SCCRQ.
As a side effect, this patch makes accel-ppp reply to SCCRQ using
an arbitrary source port, as specified in RFC 2661.
Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
|
|
Directly pass the framing capabilities argument of l2tp_tunnel_alloc()
as an integer. The previous type (struct l2tp_attr_t *) won't
make make sense when creating a tunnel in situations different from
SCCRQ message handling.
Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
|
|
Peer TID assignment is specific to SCCRQ message processing. When
creating a tunnel in different conditions (e.g. upon user request),
the peer TID will be unknown.
This patch moves peer TID assignment from l2tp_tunnel_alloc() to
l2tp_recv_SCCRQ().
Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
|
|
Register and start triton contexts/handlers in l2tp_tunnel_start()
instead of l2tp_tunnel_alloc(). The objective is to make
l2tp_tunnel_alloc() more generic by removing some specific
initialisation code. At a later stage, these would be done by the
caller between the calls to l2tp_tunnel_alloc() and l2tp_tunnel_start().
Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
|
|
Avoid unregistering uninitialised tunnel data when freeing tunnel
structures. This makes l2tp_tunnel_free() suitable for freeing
partially initialised tunnels.
Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
|
|
Update the prototype of l2tp_tunnel_alloc() so that it returns the
allocated tunnel structure. This will allow the caller to act on the
newly created tunnel in different ways depending on the creation
context.
Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
|
|
Verify return values of functions called by l2tp_tunnel_alloc().
Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
|
|
Don't send the EV_CTRL_FINISHED event when closing sessions which
haven't been established, because no corresponding EV_CTRL_STARTED
events have been sent by such sessions.
Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
|
|
Call regexp command handler without command line's leading spaces.
This makes leading spaces handling consistent between the exec and help
command handlers (leading spaces are already skipped before calling
help handlers).
This also gives the possibility to register an anchored regexp command
without having to manage the leading spaces in that regexp.
Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
|
|
Match PPPoE "exec" and "help" commands. This makes the PPPoE module
behave nicely with the new help command handling.
For example:
* "help pppoe set" won't print help messages for the "pppoe show"
set of commands
* "help pppoe mac-filter add" will only print help message for this
specific command (i.e. without the other "pppoe mac-filter" ones)
Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
|
|
When arguments are supplied to the "help" command, only display help
messages corresponding to the command these arguments refer to (e.g.
"help pppoe" will only show help messages for commands starting
with "pppoe").
Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
|
|
Pass a full string, instead of an array of words, to the "help" callback
of regexp command handlers. Also register these command handlers using
a regexp to apply on "help" commands, just like for exec commands. The
"help" callback will then be called only if the command matches the
"help" regexp.
As a side effect, the "help" word and its following spaces are skipped
before calling the "help" callback for both simple and regexp commands.
Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
|
|
* skip_word(): ensure the for() loop won't pass over a '\0' character
* split(): ensure the for() loop won't try to fill buf[MAX_CMD_ITEMS]
* split(): skip leading spaces.
* split(): fix exit value if no item is found (return 0 instead of 1)
Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
|
|
Split regexp and simple command handling from the generic command
processing function and handle regexp commands before simple ones.
This avoids splitting the original command line before processing
regexp command handlers, so that these handlers get the full command
line instead of only the first word.
The regexp command handlers are now only called when the command
matches the regexp (regexp handlers were called unconditionaly
before this patch). The rest of the processing properties should
remain unchanged.
Command processing summary:
-If the command starts with the "help" keyword, then all help
commands are called, starting with regexp help commands.
-Otherwise, regexp command handlers whose regexp matches the
command line are called. Then, simple command handlers whose
header matches the command line are called.
Any command handler that returns a value different from
CLI_CMD_OK stops the process, thus preventing the following
handlers from being called.
Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
|
|
Process "help" commands in a separated function with no side effect
when the command doesn't match. This avoids splitting the input
command line if not necessary (regexp command handlers need to
receive the entire command line for being useful).
Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
|
|
* Call pcre_compile2() with all mandatory arguments and
improve error message.
* Register regexp commands in regexp_cmd_list instead of
simple_cmd_list.
* Fix "help" function call.
* Interpret regexp command return codes (CLI_CMD_*) in the
same way as for simple commands.
Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
|
|
Since it's not possible to mix incomming and outgoing states in
a session, the "state2" field isn't necessary.
Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
|
|
Add the "l2tp create session" command to place an outgoing call.
For example, "l2tp create session tid 3" will send an OCRQ within
tunnel 3.
This allows the LNS to request establishment of a new session inside
an existing tunnel.
Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
|
|
This patch removes the automatic sending of a CDN message when
cancelling creation of new sessions. This is necessary in order
to give the possibility for a tunnel to create (and possibly cancel)
new sessions on its own (e.g. for placing outgoing calls). In such
cases, sending a CDN message would not make sense if the session gets
cancelled before any creation message was sent.
Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
|
|
Define the u_readlong() function as a wrapper for strtol(). It performs
stricter checks on the input value and let the caller specify an interval
of acceptable values.
Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
|
|
Move definition of ACCEL_PPP_VERSION from /accel-pppd/CMakeLists.txt
to /CMakeLists.txt so that it gets visible by any cmake file.
Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
|
|
|
|
ipoe: fixed DHCP Discover handling when session is in active state
|
|
|
|
|
|
|
|
|
|
This reverts commit cde7ee4d629b32c810ceac836b70a4289b4f00b3.
|
|
|
|
|
|
|
|
This reverts commit 2b9c6812f4558b74843c6e3740ee5319dc1df48d.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Explicitely interpret zero values when parsing boolean options. This
allows to unset boolean parameters such as "verbose" when reloading
the configuration.
Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
|
|
|
|
Retrieve the socket address size from the address passed to connect().
Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
|
|
Use l2tp_tunnel_alloc() cleanup code for handling TID assignment
failure. The previous manual cleanup did not close the triton handler
file descriptor.
Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
|
|
Tunnel establishment may not be immediately followed by the creation of
a new session. In this case there is no message to send to the peer
after receiving an SCCCN; so it won't be acknowledged and the peer will
then have to retransmit it.
This patch makes the tunnel always acknowledge SCCCN by replying with a
ZLB, thus avoiding useless retransmission from the peer.
Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
|
|
Send a ZLB upon reception of a CDN message.
Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
|
|
Update call to l2tp_send_CDN() to avoid using the 0 result code
(reserved by RFC 2661).
Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
|