diff options
author | xebd <xeb@mail.ru> | 2019-05-10 10:04:56 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-10 10:04:56 +0300 |
commit | 2d5fb5e4aad86c440ecb7ebd4deb93901e21b8f3 (patch) | |
tree | e56efd1cc38274183fe899a58c504df58130af23 /accel-pppd | |
parent | 1f835bb6bb54cf186e549d58318090b988b6b93a (diff) | |
parent | 3761f107ea954021ce2f7c9b7743073c1b92187d (diff) | |
download | accel-ppp-2d5fb5e4aad86c440ecb7ebd4deb93901e21b8f3.tar.gz accel-ppp-2d5fb5e4aad86c440ecb7ebd4deb93901e21b8f3.zip |
Merge pull request #72 from DmitriyEshenko/master
Add information to accel-ppp.conf.5 [common] section and [modules]log_syslog and [ipoe]offer-timeout
Diffstat (limited to 'accel-pppd')
-rw-r--r-- | accel-pppd/accel-ppp.conf.5 | 53 | ||||
-rw-r--r-- | accel-pppd/ctrl/ipoe/ipoe.c | 11 |
2 files changed, 47 insertions, 17 deletions
diff --git a/accel-pppd/accel-ppp.conf.5 b/accel-pppd/accel-ppp.conf.5 index 9ccac7d5..7c4b57af 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 @@ -83,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. @@ -120,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 @@ -390,6 +412,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 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) { |