ipoe: fixed parsing 'range' option

Signed-off-by: Dmitry Kozlov <xeb@mail.ru>
fixed missing spinlock initialized (fixes stuck)

Signed-off-by: Dmitry Kozlov <xeb@mail.ru>
crypto: don't build/install empty library if not used

Signed-off-by: Vladislav Grishenko <themiron@mail.ru>
ppp: don't unconditionaly load pppoe/pptp/l2tp modules, fixes false start warning if they're running already

Signed-off-by: Vladislav Grishenko <themiron@mail.ru>
Revert "ppp: don't unconditionaly load pppoe/pptp/l2tp modules, fixes false start warning if they're running already"

This reverts commit c4ddc0fe1f402f84b1bb01b9568e2294569d0d15.
ppp: don't unconditionaly load pppoe/pptp/l2tp modules, fixes false start warning if they're running already

Signed-off-by: Vladislav Grishenko <themiron@mail.ru>
pppoe: check for tag format validity in PADR messages

Avoid parsing inconsistent PPPoE tags when handling PADR.

Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
pppoe: fix Minimum-Data-Rate-Downstream TR101 sub-tag handling

As per TR-101 specifications and RFC 4679, 0x84 is the sub-tag
number for Minimum-Data-Rate-Downstream (instead of
Maximum-Data-Rate-Upstream).

Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
pppoe: fix TR-101 attribute filtering for RADIUS access requests

When a sub-tags is skipped while parsing a TR-101 tag, the ptr variable
must be updated to point to the next sub-tag, otherwise the next loop
iteration erroneously interprets tag information.

While here, fix the range of attribute that mustn't be present in RADIUS
access requests (RFC 4679, section 4).

Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
pppoe: fix TR-101 tag length check

The length field of PPPoE TR-101 sub-tags only takes the payload size
into account (as opposed to its RADIUS counterpart that stores the
full sub-tag length, including the 2 bytes long header).

Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
pppoe: add missing support for some TR-101 sub-tags

These are all 4 bytes integer values, except ACCESS_LOOP_ENCAP
which represents three independant values of one byte each.

Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
radius: allow creation of zero length attributes

Some attributes, like IWF-Session (RFC 4679), may have no payload.
Allow the len parameter of rad_packet_add_octets() to be 0 in order
to add such attributes (and do the same for rad_packet_change_octets()
for API consistency).

Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
pppoe: handle IFW-SESSION TR-101 sub-tag

This TR-101 sub-tag has no payload.

Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
increase size of buffer for netlink messages

Signed-off-by: Dmitry Kozlov <xeb@mail.ru>
radius: fix IWF-Session identifier in RFC 4679 dictionary

RFC 4679 assigns identifier 0xFE (254) to the IWF-Session attribute.
This is consistent with the identifier value specified by TR-101.

Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
pppoe: handle TR-101 vs. RFC 4679 incompatibilities

There are a few inconsistencies between TR-101 and RFC 4679.
Since RFC 4679 is only informational, prefer TR-101 in case
of incompatibilities and explicitely document this choice.

Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
pppoe: fix typo

Signed-off-by: Dmitry Kozlov <xeb@mail.ru>
ippool: add support for old style pool name declaration

Signed-off-by: Dmitry Kozlov <xeb@mail.ru>
l2tp: define tunnel specific secrets

Store tunnel secret in the l2tp_conn_t structure so that different
tunnels may use different secrets.

The new "secret" option, added to the "l2tp create tunnel" command,
let the user define the secret to be used by the new tunnel.
By default, new tunnels keep using the "secret" option defined in
accel-ppp.conf.

Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
l2tp: reset conf_secret if secret removed from accel-ppp.conf

The "reload" command frees the variable pointed to by conf_secret
in case the "secret" option gets removed from accel-ppp.conf. In
such a case, conf_secret must be reset to NULL to avoid dereferencing
the old pointer.

Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>