From 4fa464296864181c3ee00e866f8b50ef3f23ec60 Mon Sep 17 00:00:00 2001
From: DmitriyEshenko <snooppy@mail.ua>
Date: Thu, 9 May 2019 01:15:22 +0300
Subject: Add information [modules]log_syslog and [ipoe]offer-timeout

---
 accel-pppd/accel-ppp.conf.5 | 6 ++++++
 1 file changed, 6 insertions(+)

(limited to 'accel-pppd')

diff --git a/accel-pppd/accel-ppp.conf.5 b/accel-pppd/accel-ppp.conf.5
index 9ccac7d5..bf907e16 100644
--- a/accel-pppd/accel-ppp.conf.5
+++ b/accel-pppd/accel-ppp.conf.5
@@ -28,6 +28,9 @@ containes list of modules to load
 .BI log_file
 This is logging target which logs messages to files. It support per-session/per-user features.
 .TP
+.BI log_syslog
+This is logging target which logs messages to syslog.
+.TP
 .BI log_tcp
 This is logging target which logs messages over TCP/IP.
 .TP
@@ -390,6 +393,9 @@ Specifies delays (also in condition of connection count) to send DHCPOFFER (ms).
 Last delay in list may be -1 which means don't accept new connections.
 List must to be sorted by count key.
 .TP
+.BI "offer-timeout=" n
+Specified timeout waiting DHCP-Request from client in seconds (default 10).
+.TP
 .BI "vlan-mon=" [re:]name[,filter]
 Starts vlan monitor on specified interface (requires ipoe kernel module).
 .br
-- 
cgit v1.2.3


From 9c40c6df0189a2fb6068cd6f92529d508b8ead7b Mon Sep 17 00:00:00 2001
From: DmitriyEshenko <snooppy@mail.ua>
Date: Thu, 9 May 2019 03:38:09 +0300
Subject: Add information about [common] section

---
 accel-pppd/accel-ppp.conf.5 | 47 +++++++++++++++++++++++++++++++--------------
 1 file changed, 33 insertions(+), 14 deletions(-)

(limited to 'accel-pppd')

diff --git a/accel-pppd/accel-ppp.conf.5 b/accel-pppd/accel-ppp.conf.5
index bf907e16..7c4b57af 100644
--- a/accel-pppd/accel-ppp.conf.5
+++ b/accel-pppd/accel-ppp.conf.5
@@ -86,6 +86,39 @@ Path to file for core module error logging.
 .TP
 .BI "thread-count=" n
 number of working threads, optimal - number of processors/cores
+.SH [common]
+Containes common params for all connection types
+.TP
+.BI "single-session=" replace|deny
+Specifies whether accel-ppp should control sessions count.
+.br
+If this option is absent session count control is turned off.
+.br
+If this option is 
+.B replace
+then accel-ppp will terminate first session when second is authorized.
+.br
+If this option is 
+.B deny
+then accel-ppp will deny second session authorization.
+.TP
+.BI "sid-case=" upper|lower
+Specifies in which case generate session identifier (default lower).
+.TP
+.BI "sid-source=" urandom|seq
+Specifies method assign session id (default urandom).
+.br
+.B urandom
+Assign session id by random method
+.br
+.B seq
+Assign session id by sequence method
+.TP
+.BI "seq-file=" path
+Path to file for sessions sequence number. Start sequence number may be set there (default /var/lib/accel-ppp/seq).
+.TP
+.BI "max-sessions=" n
+Specifies maximum sessions which server may processed (default 0, disabled)
 .SH [ppp]
 .br
 PPP module configuration.
@@ -123,23 +156,9 @@ Protocol field compression negotiation.
 .BI "ccp=" n
 Disable CCP negotiation if this parameter is zero.
 .TP
-.BI "sid-case=" upper|lower
-Specifies in which case generate session identifier (default lower).
-.TP
 .BI "check-ip=" 0|1
 Specifies whether accel-ppp should check if IP already assigned to other ppp interface (default 0).
 .TP
-.BI "single-session=" replace|deny
-Specifies whether accel-ppp should control sessions count.
-.br
-If this option is absent session count control is turned off.
-If this option is 
-.B replace
-then accel-ppp will terminate first session when second is authorized.
-If this option is 
-.B deny
-then accel-ppp will deny second session authorization.
-.TP
 .BI "mppe=" require|prefer|deny
 Specifies mppe negotioation preference.
 .br
-- 
cgit v1.2.3


From 3761f107ea954021ce2f7c9b7743073c1b92187d Mon Sep 17 00:00:00 2001
From: DmitriyEshenko <snooppy@mail.ua>
Date: Thu, 9 May 2019 12:54:44 +0300
Subject: ipoe: Fix send NAK for REQUEST with 3 same XID for not existing
 sessions

---
 accel-pppd/ctrl/ipoe/ipoe.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

(limited to 'accel-pppd')

diff --git a/accel-pppd/ctrl/ipoe/ipoe.c b/accel-pppd/ctrl/ipoe/ipoe.c
index b8082a64..6620b401 100644
--- a/accel-pppd/ctrl/ipoe/ipoe.c
+++ b/accel-pppd/ctrl/ipoe/ipoe.c
@@ -1646,7 +1646,7 @@ static int ipoe_serv_request_check(struct ipoe_serv *serv, uint32_t xid)
 			list_del(&r->entry);
 			mempool_free(r);
 		} else if (r->xid == xid) {
-			if (++r->cnt == conf_max_request) {
+			if (++r->cnt >= conf_max_request) {
 				list_del(&r->entry);
 				mempool_free(r);
 				return 1;
@@ -1660,7 +1660,7 @@ static int ipoe_serv_request_check(struct ipoe_serv *serv, uint32_t xid)
 	r = mempool_alloc(req_item_pool);
 	r->xid = xid;
 	r->expire = ts.tv_sec + 30;
-	r->cnt = 0;
+	r->cnt = 1;
 	list_add_tail(&r->entry, &serv->req_list);
 
 	return 0;
@@ -1825,7 +1825,12 @@ static void __ipoe_recv_dhcpv4(struct dhcpv4_serv *dhcpv4, struct dhcpv4_packet
 			else if (opt82_ses) {
 				dhcpv4_packet_ref(pack);
 				triton_context_call(&opt82_ses->ctx, (triton_event_func)mac_change_detected, pack);
-			} else if (ipoe_serv_request_check(serv, pack->hdr->xid))
+			}
+
+			if (ap_shutdown)
+				goto out;
+
+			if (ipoe_serv_request_check(serv, pack->hdr->xid))
 				dhcpv4_send_nak(dhcpv4, pack);
 		} else {
 			if (ses->terminate) {
-- 
cgit v1.2.3