summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-11-03triton: fix context schedule/wakeup raceGuillaume Nault
Allow triton_context_wakeup() to run before triton_context_schedule(). When that happens, triton_context_schedule() now lets the context running instead of putting it in sleep mode. Note that, even though triton now allows triton_context_wakeup() to happen before triton_context_schedule(), these two functions still need to be paired and not nested. That is, in a sequence like the following, triton_context_wakeup() triton_context_wakeup() triton_context_schedule() triton_context_schedule() the second triton_context_schedule() would put the context in sleep mode. No matter how many triton_context_wakeup() have been called, the first triton_context_schedule() "consumes" them all. Being immune to schedule/wakeup inversion allows to fix the pppd_compat module. This module needs to fork() to execute external programs. The parent then waits for completion of its child using triton_context_schedule(). When child terminates, the sigchld module runs a callback that has to call triton_context_wakeup() to resume execution of the parent. The problem is that there is no synchronisation between the parent and its child. When under stress, the child may execute faster than its parent and the sigchld callback might run triton_context_wakeup() before the parent had time to call triton_context_schedule(). Then accel-ppp might crash because the triton thread might have reset ctx->thread to NULL, making triton_context_wakeup() write to invalid memory when trying to insert the context in ctx->thread->wakeup_list[]. Synchronising the parent and its child completion's callback would require cooperation from triton_context_schedule(). Otherwise we would still have a time frame between the moment we let the callback waking up the context and the moment we put the context in sleep mode. Allowing schedule/wakeup call inversion in triton looks simpler since it avoids modifying the current API. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
2018-10-29Merge pull request #57 from themiron/sstpxebd
sstp: fix build w/o openssl & with 1.1.0-1.1.0g
2018-10-26sstp: fix build w/o opensslVladislav Grishenko
2018-10-26sstp: fix build with openssl 1.1.0-1.1.0gVladislav Grishenko
2018-10-26Merge branch 'master' of https://github.com/xebd/accel-pppDmitry Kozlov
2018-10-26cli: fix include directive for list.hGuillaume Nault
list.h is an accel-ppp internal file. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
2018-10-26vlan_mon: make vlan_mon.h self-containedGuillaume Nault
We need to include <stdint.h> to define 'uint16_t'. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
2018-10-26triton: make mempool.h self-contained even when MEMDEBUG is definedGuillaume Nault
If MEMDEBUG is defined, then we need to include "memdebug.h" to define 'md_free'. 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-10-26ppp: make ppp_fsm.h self-containedGuillaume Nault
We need to include <stdint.h> to define 'uint16_t' and "triton.h" for 'struct triton_timer_t'. Also, let's include "ppp.h" so that we don't need a forward declaration for 'struct ppp_t'. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
2018-10-26ppp: make ppp_auth.h self-containedGuillaume Nault
We need to include <stdint.h> to define 'uint8_t' and "ppp.h" for 'struct ppp_t'. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
2018-10-26ppp: make ppp_lcp.h self-containedGuillaume Nault
We need to include "ppp.h" to define 'struct ppp_layer_data_t' and 'struct ppp_handler_t'. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
2018-10-26memdebug: make memdebug.h self-contained even when MEMDEBUG isn't definedGuillaume Nault
We need to include <stdio.h> to define 'asprintf', <stdlib.h> for 'malloc', 'realloc' and 'free' and <string.h> for 'strdup' and 'strndup'. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
2018-10-26lua: make luasupp.h self-containedGuillaume Nault
We need to include "ap_session.h" to define 'struct ap_session'. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
2018-10-26libnetlink: make libnetlink.h self-containedGuillaume Nault
We need to include <sys/types.h> to define 'pid_t'. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
2018-10-26libnetlink: make ipset.h self-containedGuillaume Nault
We need to include <netinet/in.h> to define 'in_addr_t'. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
2018-10-26iputils: make iputils.h self-containedGuillaume Nault
We need to include <stdint.h> to define 'uint32_t' and <netinet/in.h> for 'in_addr_t' and 'struct in6_addr'. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
2018-10-26core: make ap_net.h self-containedGuillaume Nault
We need to include <sys/socket.h> to define 'socklen_t', <sys/types.h> for 'ssize_t' and "list.h" for 'struct list_head'. Also, let's include "libnetlink.h" so that we don't need a forward declaration for 'struct rtnl_handle'. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
2018-10-26connlimit: make connlimit.h self-containedGuillaume Nault
We need to include <stdint.h> to define 'uint*_t' and <string.h> for 'memcpy'. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
2018-10-26backup: make backup.h self-containedGuillaume Nault
We need to include <sys/types.h> to define 'size_t'. 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-10-26backup: make ap_session_backup.h self-containedGuillaume Nault
We need to include <netinet/in.h> to define 'struct in6_addr' and <stdint.h> for 'uint8_t'. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
2018-10-26Merge pull request #56 from themiron/addr-setup-fixxebd
fix gateway address setup fail due memory corruption
2018-10-26Merge pull request #55 from themiron/sstpxebd
sstp updates
2018-10-25fix gateway address setup fail due memory corruptionVladislav Grishenko
log: libnetlink: RTNETLINK answers: Invalid argument ppp0: f7bb00a79ef667d2: failed to set IPv4 address: Invalid argument ipaddr_add_peer() called only with mask equeal 0 or 32, but w/o zero-allocated structs it contans garbage in some cases. so, instead ipaddr_add() was called with wrong mask value. also, init chap-secrets mask for the same reason.
2018-10-25sstp: disable ciphers renegotiation (CVE-2009-3555)Vladislav Grishenko
2018-10-25sstp: improve openssl 1.1.x compatibilityVladislav Grishenko
2018-10-23cli: add network namespace column in "show sessions"Guillaume Nault
Define a new column, called "netns", that prints the network namespace in which sessions are set. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
2018-10-23ipv6: fix IPv6 processing of sessions that only have only a link-local addressGuillaume Nault
Several modules assume that if ses->ipv6 is set, then ses->ipv6->addr_list contains at least one element. But this is not true if ipv6 was allocated by the pseudo ipdb backend of ipv6cp (ipv6cp_opt_intfid.c). That is, if the PPP session only has an automatic link-local address. This leads modules like pppd-compat and dhcpv6 to access invalid memory when trying to retrieve the IPv6 address of a PPP session. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
2018-08-24load ipoe and vlan_mon module on startDmitry Kozlov
2018-07-31Merge branch 'master' of ssh://git.code.sf.net/p/accel-ppp/codeDmitry Kozlov
2018-07-31Merge branch 'master' of github.com:xebd/accel-pppDmitry Kozlov
2018-06-24pppd_compat: fix indentation in ev_radius_coa()Guillaume Nault
Missing tab was misleading. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
2018-06-24pppd_compat: run scripts in the PPP device netnsGuillaume Nault
If the PPP device is set up into a specific network namespace, all the configuration that goes with it belongs to this same netns. Therefore, we need to run the up/down scripts in that namespace too. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
2018-06-24pppd_compat: fix argv[0] when calling ip-pre-upGuillaume Nault
The first argument passed to the ip-pre-up script, was mistakenly set to the value of ip-up. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
2018-06-08Merge branch 'master' of ssh://git.code.sf.net/p/accel-ppp/codeDmitry Kozlov
2018-06-08ipoe: use vendor option for attr_dhcp_opt82_xxx tooDmitry Kozlov
2018-06-06Merge pull request #52 from themiron/sstpxebd
sstp: add ECDSA certs support and DH/ECDH config options
2018-06-05sstp: add ECDSA certs support and ssl-ecdh-curve option for ECDHE ciphersVladislav Grishenko
2018-06-05sstp: add ssl-dhparam option for DHE ciphersVladislav Grishenko
2018-06-05Merge pull request #51 from themiron/sstpxebd
sstp: fix station_ids, add stat/snmp support & full crypto binding validation
2018-06-04Merge branch 'master' of https://github.com/xebd/accel-pppDmitry Kozlov
2018-06-04sstp: snmp: add missed files, fix 0d454ad7102506ecd12a36239f6604f7e4b57aaeVladislav Grishenko
2018-06-03sstp: use generic HTTP/1.0 error codes for better compatibilityVladislav Grishenko
2018-06-03sstp: add disconnection reason loggingVladislav Grishenko
2018-06-03sstp: implement Compound MAC validationVladislav Grishenko
2018-06-03sstp: add snmp supportVladislav Grishenko
2018-06-03sstp: add session events & stat supportVladislav Grishenko
2018-06-02sstp: drop port from calling_station_id/called_station_idVladislav Grishenko
2018-06-01Merge pull request #50 from themiron/sstpxebd
sstp: allow custom http server response & other fixes
2018-06-01sstp: fix proxy proto v1 over ipv6Vladislav Grishenko