summaryrefslogtreecommitdiff
path: root/accel-pppd/radius
AgeCommit message (Collapse)Author
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
2014-10-22radius: check for previous request was finished in interim update timerDmitry Kozlov
2014-10-06radius: fixed Accounting-On/Accounting-Off functionalityDmitry Kozlov
2014-10-04radius: various bug fixesDmitry Kozlov
2014-10-03get rid of time(), use clock_gettime(CLOCK_MONOTONIC) insteadDmitry Kozlov
2014-09-30radius: fixed handling deferred requestsDmitry Kozlov
2014-09-26radius: cancel starting accounting request if session terminated before ↵Dmitry Kozlov
server replied
2014-09-23radius: fixed counting of active requestsDmitry Kozlov
2014-09-22fixed compilation warningsDmitry Kozlov
2014-09-20rewrite of authentication/accounting proceduresDmitry Kozlov
This patch gets rid of synchronuos style of authentication/accounting. Synchronous style of authentication/accounting produced sleeping threads which becomes a problem when lots of sessions started/stopped and all they want authorization/accounting.
2014-08-25radius: delete timeout timer if request sending fails (fixes double server ↵Dmitry Kozlov
release)
2014-08-04radius: terminate session if read interfaces statistics failsDmitry Kozlov
2014-08-01radius: close socket after receiving accounting responseDmitry Kozlov