summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--accel-pppd/accel-ppp.conf.553
-rw-r--r--accel-pppd/ctrl/ipoe/ipoe.c13
-rw-r--r--accel-pppd/extra/ippool.c5
-rw-r--r--accel-pppd/extra/pppd_compat.c9
-rw-r--r--accel-pppd/radius/acct.c3
-rw-r--r--accel-pppd/radius/dm_coa.c12
6 files changed, 69 insertions, 26 deletions
diff --git a/accel-pppd/accel-ppp.conf.5 b/accel-pppd/accel-ppp.conf.5
index 9ccac7d..7c4b57a 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 b8082a6..5438b61 100644
--- a/accel-pppd/ctrl/ipoe/ipoe.c
+++ b/accel-pppd/ctrl/ipoe/ipoe.c
@@ -1002,7 +1002,7 @@ static void __ipoe_session_activate(struct ipoe_session *ses)
ses->timer.expire = ipoe_session_timeout;
ses->timer.period = 0;
- ses->timer.expire_tv.tv_sec = ses->lease_time;
+ ses->timer.expire_tv.tv_sec = conf_lease_timeout > ses->lease_time ? conf_lease_timeout : ses->lease_time;
if (ses->timer.tpd)
triton_timer_mod(&ses->timer, 0);
}
@@ -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) {
diff --git a/accel-pppd/extra/ippool.c b/accel-pppd/extra/ippool.c
index 73ad398..44f450c 100644
--- a/accel-pppd/extra/ippool.c
+++ b/accel-pppd/extra/ippool.c
@@ -256,7 +256,8 @@ static void generate_pool_p2p(struct ippool_t *p)
addr = list_entry(p->gw_list.next, typeof(*addr), entry);
list_del(&addr->entry);
}
- }
+ } else if (conf_gw_ip_address == peer_addr->addr)
+ continue;
it = malloc(sizeof(*it));
if (!it) {
@@ -354,6 +355,8 @@ again:
else
it->it.addr = 0;
+ it->it.mask = 0;
+
return &it->it;
} else if (p->next) {
p = p->next;
diff --git a/accel-pppd/extra/pppd_compat.c b/accel-pppd/extra/pppd_compat.c
index 6761e5b..421c598 100644
--- a/accel-pppd/extra/pppd_compat.c
+++ b/accel-pppd/extra/pppd_compat.c
@@ -517,6 +517,7 @@ static void write_radattr(struct pppd_compat_pd *pd, struct rad_packet_t *pack)
char fname1[PATH_MAX], fname2[PATH_MAX];
int fd, i;
in_addr_t addr;
+ char ip_str[50];
if (ses->state == AP_STATE_ACTIVE) {
sprintf(fname1, "%s.%s", conf_radattr_prefix, ses->ifname);
@@ -563,6 +564,14 @@ static void write_radattr(struct pppd_compat_pd *pd, struct rad_packet_t *pack)
case ATTR_TYPE_DATE:
fprintf(f, "%lu\n", (unsigned long) attr->val.date);
break;
+ case ATTR_TYPE_IPV6PREFIX:
+ inet_ntop(AF_INET6, &attr->val.ipv6prefix.prefix, ip_str, sizeof(ip_str));
+ fprintf(f, "%s/%i\n", ip_str, attr->val.ipv6prefix.len);
+ break;
+ case ATTR_TYPE_IPV6ADDR:
+ inet_ntop(AF_INET6, &attr->val.ipv6addr, ip_str, sizeof(ip_str));
+ fprintf(f, "%s\n", ip_str);
+ break;
}
}
fclose(f);
diff --git a/accel-pppd/radius/acct.c b/accel-pppd/radius/acct.c
index e4daedb..b17016d 100644
--- a/accel-pppd/radius/acct.c
+++ b/accel-pppd/radius/acct.c
@@ -88,7 +88,8 @@ static void rad_acct_recv(struct rad_req_t *req)
stat_accm_add(req->serv->stat_interim_query_1m, dt);
stat_accm_add(req->serv->stat_interim_query_5m, dt);
- triton_timer_del(&req->timeout);
+ if (req->timeout.tpd)
+ triton_timer_del(&req->timeout);
triton_md_unregister_handler(&req->hnd, 1);
diff --git a/accel-pppd/radius/dm_coa.c b/accel-pppd/radius/dm_coa.c
index ea9743d..f967ec6 100644
--- a/accel-pppd/radius/dm_coa.c
+++ b/accel-pppd/radius/dm_coa.c
@@ -173,13 +173,13 @@ static void coa_request(struct radius_pd_t *rpd)
memcpy(rpd->attr_class, class->val.octets, class->len);
rpd->attr_class_len = class->len;
- }
- if (rpd->acct_req && rpd->acct_req->pack) {
- if (prev_class)
- rad_packet_change_octets(rpd->acct_req->pack, NULL, "Class", rpd->attr_class, rpd->attr_class_len);
- else
- rad_packet_add_octets(rpd->acct_req->pack, NULL, "Class", rpd->attr_class, rpd->attr_class_len);
+ if (rpd->acct_req && rpd->acct_req->pack) {
+ if (prev_class)
+ rad_packet_change_octets(rpd->acct_req->pack, NULL, "Class", rpd->attr_class, rpd->attr_class_len);
+ else
+ rad_packet_add_octets(rpd->acct_req->pack, NULL, "Class", rpd->attr_class, rpd->attr_class_len);
+ }
}
attr = rad_packet_find_attr(rpd->dm_coa_req, NULL, "Session-Timeout");