summaryrefslogtreecommitdiff
path: root/accel-pppd/radius
AgeCommit message (Collapse)Author
2020-01-20radius: implement jitter of accounting update intervalVladislav Grishenko
2020-01-10ipv6pool/radius: implement named ipv6 poolsVladislav Grishenko
default stateful ipv6 address & prefix radius attrs are per-rfc6911: 171 Delegated-IPv6-Prefix-Pool 172 Stateful-IPv6-Address-Pool the single pool name from chap-secret file pool is shared for ipv4/ipv6/ipv6 dp, new config syntax TBD. per-proto pool names are still for ipv4 only, new config syntax TBD.
2019-08-30radius: dm/coa: add invalid packet loggingVladislav Grishenko
2019-08-29radius: add support for Access-Accept usernameVladislav Grishenko
once radius server has returned User-Name attribute in Access-Accept packet, it'll be used for any subsequent Accounting-Request packets instead of internal username per RFC2865 5.1 other way of just replacing session username is possible, but not desired at the moment due potential issues with single-session modes in case of different ppp logins / ipoe macs and same contract number returned by radius for that accounts.
2019-08-26[Fix] - Increment Accounting-Request id for Acct-Status-Type Stoproot
2019-06-27Update radius.cEshenko Dmitriy
2019-05-10Fix bug after radius server recoveryroot
2019-03-08radius: fixed bug (inserting empty Class)Dmitry Kozlov
2018-12-20radius: specify gateway in iproute_del()Guillaume Nault
Be more specific about which route we want to remove. By not specifying the gateway we could remove a different route than the one we originally inserted. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
2018-12-20iputils: add 'src' and 'gw' parameters to iproute_del()Guillaume Nault
Rework iproute_del() to have the same parameters as iproute_add(). This will allow callers to specify more precisely the route they want to delete. Callers will later be converted to make use of these parameters to ensure that the removed route precisely matches the one that was originaly inserted. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
2018-12-04radius: implement Framed-IPv6-Route attributeGuillaume Nault
Framed-IPv6-Route is the IPv6 counterpart of Framed-Route. It's only used for defining routes to be added locally by accel-ppp. Routes that should be announced to the peer using Router Advertisements should be defined in the Route-IPv6-Information attribute (but that's currently not implemented). Framed-IPv6-Route format is: <network in CIDR notation> [<gateway IPv6 address> [<route metric>]] The gateway address and the route metric are optionals, but the metric can only be set if a gateway address is given. One can use the unspecified address '::' to define a route with no gateway and a non-default route metric. When no gateway address is defined, the session's network interface is used directly. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
2018-11-12ipcp: fix uninitialised memory access when negociating *-NBNS-AddressGuillaume Nault
When handling the EV_WINS event, IPCP assumes that the ->wins1 and ->wins2 fields of the event structure are properly set. But that may not be the case. If only one of the MS-Primary-NBNS-Server or MS-Secondary-NBNS-Server RADIUS attributes was received, then only ->wins1 or ->wins2 is set, while the other keeps a non initialised value. This uninitialised value is then copied by ev_wins() and proposed to the peer when negociating the Primary-NBNS-Address or Secondary-NBNS-Address IPCP options. That leaks four bytes of the stack to the network and prevents using the values found in the [wins] section of accel-ppp.conf as fallback. Fix this by initialising the whole event structure in rad_proc_attrs(). Then, in ev_wins(), we can check if ->wins1 or ->wins2 is properly set before copying them. That allows to propery fallback to accel-ppp.conf values when one of the values was not provided by RADIUS. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
2018-11-12ipcp: fix uninitialised memory access when negociating *-DNS-AddressGuillaume Nault
When handling the EV_DNS event, IPCP assumes that the ->dns1 and ->dns2 fields of the event structure are properly set. But that may not be the case. If only one of the MS-Primary-DNS-Server or MS-Secondary-DNS-Server RADIUS attributes was received, then only ->dns1 or ->dns2 is set, while the other keeps a non initialised value. This uninitialised value is then copied by ev_dns() and proposed to the peer when negociating the Primary-DNS-Address or Secondary-DNS-Address IPCP options. That leaks four bytes of the stack to the network and prevents using the values found in the [dns] section of accel-ppp.conf as fallback. Fix this by initialising the whole event structure in rad_proc_attrs(). Then, in ev_dns(), we can check if ->dns1 or ->dns2 is properly set before copying them. That allows to propery fallback to accel-ppp.conf values when one of the values was not provided by RADIUS. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
2018-10-26radius: make radius.h self-containedGuillaume Nault
We need to include "list.h" to define 'struct list_head' and <netinet/in.h> for 'in_addr_t' and 'struct in6_addr'. Also, let's include "ap_session.h" so that we don't need a forward declaration for 'struct ap_session'. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
2018-04-12radius: initialize rad_attr_t::raw field on newly inserted attributesDmitry Kozlov
2018-04-06radius: allow CoA/DM by single username attributeDmitry Kozlov
2018-03-04fix possible null pointer dereferencesVladislav Grishenko
2018-02-21radius: add support for route priority (metric) in Framed-RouteGuillaume Nault
Let an optional route priority (aka metric) be defined in RADIUS Framed-Route attributes. The priority is an integer placed at the end of the route string. This is backward compatible with the previous format and also conforms with the recommended format defined by RFC 2865 (although we don't allow multiple metrics). Framed-Route format is: <network> [<gateway> [<priority>]] For example, 'Framed-Route = "192.0.2.0/24 203.0.113.1 8"' will let the following route be installed (assuming 203.0.113.1 is routed through eth0): $ ip route show [...] 192.0.2.0/24 via 203.0.113.1 dev eth0 metric 8 It's possible to use the unspecified gateway (0.0.0.0) if one wants to set a priority without specifying a gateway address. Finally, route deletion now also takes the priority into account, in order to avoid removing a different route accidentally. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
2018-02-19radius: fixed invalid behaviour when route to radius server is not existingDmitry Kozlov
2017-12-26reworked context prioritiesDmitry Kozlov
Introduced 4 priorities: 0 - management (cli) 1 - starting sessions (default priority) 2 - active sessions 3 - finishing sessions
2017-12-21radius: allocate memory for string attributesDmitry Kozlov
2017-12-14radius: fixed memory leakDmitry Kozlov
2017-12-07cmake: set INSTALL_RPATH for radius moduleDmitry Kozlov
2017-10-17radius: implemented lua supportDmitry Kozlov
to get radius object use session:module("radius") function radius object provides flollowing functions: radius:attrs() - returns array of attributes {"name" = NAME, "vendor" = VENDOR|nil} radius:attr(name[,vendor]) - returns value of attribute (may return multiple results) Example: function ip_up(ses) rad = ses:module("radius") attrs = rad:attrs() if attrs then print("attrs:") for _,a in pairs(attrs) do io.write("\t") if a.vendor then io.write(a.vendor..":") end io.write(a.name.."=") print(rad:attr(a.name, a.vendor)) end end end
2017-10-09radius: split request queue to 2 subqueuesDmitry Kozlov
1 - is high priority queue for Access-Request and Account-Request(Start) 2 - is low priority queue for Account-Request(Alive) and Account-Request(Stop) This patch intended to prioritize sessions connecting requests over disconnects and interim updates.
2016-12-10radius: extended support for freeradius dictionariesDmitry Kozlov
2016-07-09radius: do not execute interface rename immediately, store new name for ↵Dmitry Kozlov
later use Bacause interface may not still exists in authentication phase
2016-06-25radius: do not send NAS-Port and NAS-Port-Id if they are undefinedDmitry Kozlov
2016-06-07Merge branch 'master' of ssh://git.code.sf.net/p/accel-ppp/codeDmitry Kozlov
2016-06-07radius: update Session-Timeout by CoADmitry Kozlov
2016-06-02radius: initialise ipv6db addresses completelyGuillaume Nault
The 'installed' bit of the allocated ipv6db_addr_t structure needs to be initialised. This is because ap_session_ifdown() reads this bit to know if the address or route needs to be removed from the kernel. The 'installed' bit is set by ap_session_accounting_started() and the ND and DHCPV6 protocol handlers, but disconnection could happen before these steps. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
2016-05-31Fixup - don't divide on unchecked values. Multiply instead.Mihail Vasilev
2016-04-30radius: add Delegated-IPv6-Prefix to accounting packetsDmitry Kozlov
2016-04-06radius: do not mark request as active if send function failsDmitry Kozlov
2016-03-18ipoe: implemented new option "start=auto"Dmitry Kozlov
If start=auto is specified then accel-pppd automatically starts session with username = interface name on shared=0 interfaces. Use it with conjuction vlan_mon. So any packet may start session.
2016-01-03Update packet.cliguojiang
radius server error packet may be coredump.
2016-01-03radius: implemented handling of Framed-Route attributeDmitry Kozlov
Framed-Route has following syntax: Framed-Route=address[/mask] [gateway] If gateway is not specified then route would be attached to session interface.
2015-02-21radius: override session's idle and timeout timers values by Idle-Timeout ↵Dmitry Kozlov
and Session-Timeout attributes
2015-02-20ppp: set unit_idx from NAS_Port attribute if presentFrançois Cachereul
Signed-off-by: François Cachereul <f.cachereul@alphalink.fr>
2014-11-22remove trailing whitespacesDmitry Kozlov
2014-11-11radius: add missing log_switchDmitry Kozlov
2014-11-10radius: disable read handler when put req into wait queue (fixes race ↵Dmitry Kozlov
conditions)
2014-11-10radius: fixed bugDmitry Kozlov
2014-11-05radius: early ipv6_dp assignmentDmitry Kozlov
2014-10-29radius: fix call to memset on rdp->auth_ctxFrançois Cachereul
The mistake was revealed by gcc 4.9.0 Signed-off-by: François Cachereul <f.cachereul@alphalink.fr> Signed-off-by: Guillaume Nault <g.nault@alphalink.fr> Signed-off-by: Dmitry Kozlov <xeb@mail.ru>
2014-10-28radius: fixed server reallocation for timed out requestsDmitry Kozlov
2014-10-23radius: fixed stuck during shutdown when radius server does not respondDmitry Kozlov
2014-10-23radius: introduced max-fail optionDmitry Kozlov
Before this patch any single fail (no responce for max_try requests) caused radius server to enter "fail" state, which may be unwanted behaviour, because radius may not respond for interim Accounting-Request by some reasons. This patch introduces "max-fail" option which specifies number of unreplied requests in a row after which server enters into "fail" state. (Actual only for multi-server configurations)
2014-10-23radius: fixed backup radius selectionDmitry Kozlov
2014-10-23radius: fixed server reallocation for queued requests if current server does ↵Dmitry Kozlov
not respond