summaryrefslogtreecommitdiff
path: root/accel-pppd/ctrl
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2018-03-06 10:32:29 +0300
committerDmitry Kozlov <xeb@mail.ru>2018-03-06 10:32:29 +0300
commitb4d57a162c386ce37544c5f2a1cfc92001e0ff4a (patch)
tree9b7d0fdc157a59a0b241320ef3b5ace597d23aea /accel-pppd/ctrl
parent95e7ea02523b09cdcb0f3f6de53174fb4a6233cf (diff)
parent746438111a78e9a88b604eeac71bdbc62ff29ab7 (diff)
downloadaccel-ppp-b4d57a162c386ce37544c5f2a1cfc92001e0ff4a.tar.gz
accel-ppp-b4d57a162c386ce37544c5f2a1cfc92001e0ff4a.zip
Merge branch 'master' of github.com:xebd/accel-ppp
Diffstat (limited to 'accel-pppd/ctrl')
-rw-r--r--accel-pppd/ctrl/ipoe/dhcpv4.c4
-rw-r--r--accel-pppd/ctrl/ipoe/ipoe.c10
-rw-r--r--accel-pppd/ctrl/l2tp/l2tp.c2
-rw-r--r--accel-pppd/ctrl/pppoe/pppoe.c3
4 files changed, 11 insertions, 8 deletions
diff --git a/accel-pppd/ctrl/ipoe/dhcpv4.c b/accel-pppd/ctrl/ipoe/dhcpv4.c
index dde50603..8a395ea8 100644
--- a/accel-pppd/ctrl/ipoe/dhcpv4.c
+++ b/accel-pppd/ctrl/ipoe/dhcpv4.c
@@ -1145,7 +1145,7 @@ void dhcpv4_reserve_ip(struct dhcpv4_serv *serv, uint32_t ip)
struct dhcpv4_packet *dhcpv4_clone_radius(struct rad_packet_t *rad)
{
struct dhcpv4_packet *pkt = dhcpv4_packet_alloc();
- uint8_t *ptr = pkt->data, *endptr = ptr + BUF_SIZE;
+ uint8_t *ptr, *endptr;
struct dhcpv4_option *opt;
struct rad_attr_t *attr;
@@ -1153,6 +1153,8 @@ struct dhcpv4_packet *dhcpv4_clone_radius(struct rad_packet_t *rad)
return NULL;
pkt->refs = 1;
+ ptr = pkt->data;
+ endptr = ptr + BUF_SIZE;
list_for_each_entry(attr, &rad->attrs, entry) {
if (attr->vendor && attr->vendor->id == VENDOR_DHCP && attr->attr->id < 256) {
diff --git a/accel-pppd/ctrl/ipoe/ipoe.c b/accel-pppd/ctrl/ipoe/ipoe.c
index 35f97d83..5fd64e2a 100644
--- a/accel-pppd/ctrl/ipoe/ipoe.c
+++ b/accel-pppd/ctrl/ipoe/ipoe.c
@@ -977,9 +977,9 @@ static void __ipoe_session_activate(struct ipoe_session *ses)
if (ses->ifindex == -1) {
if (!conf_ip_unnumbered)
- iproute_add(serv->ifindex, ses->router, ses->yiaddr, 0, conf_proto, ses->mask);
+ iproute_add(serv->ifindex, ses->router, ses->yiaddr, 0, conf_proto, ses->mask, 0);
else if (!serv->opt_ifcfg)
- iproute_add(serv->ifindex, serv->opt_src ?: ses->router, ses->yiaddr, 0, conf_proto, 32);
+ iproute_add(serv->ifindex, serv->opt_src ?: ses->router, ses->yiaddr, 0, conf_proto, 32, 0);
}
if (ses->l4_redirect)
@@ -1078,7 +1078,7 @@ static void ipoe_session_started(struct ap_session *s)
if (ses->ses.ipv4->peer_addr != ses->yiaddr)
//ipaddr_add_peer(ses->ses.ifindex, ses->router, ses->yiaddr); // breaks quagga
- iproute_add(ses->ses.ifindex, ses->router, ses->yiaddr, 0, conf_proto, 32);
+ iproute_add(ses->ses.ifindex, ses->router, ses->yiaddr, 0, conf_proto, 32, 0);
if (ses->ifindex != -1 && ses->xid) {
ses->dhcpv4 = dhcpv4_create(ses->ctrl.ctx, ses->ses.ifname, "");
@@ -1163,9 +1163,9 @@ static void ipoe_session_finished(struct ap_session *s)
if (serv->opt_ifcfg)
ipaddr_del(serv->ifindex, ses->router, conf_ip_unnumbered ? 32 : ses->mask);
else if (conf_ip_unnumbered)
- iproute_del(serv->ifindex, ses->yiaddr, conf_proto, 32);
+ iproute_del(serv->ifindex, ses->yiaddr, conf_proto, 32, 0);
else
- iproute_del(serv->ifindex, ses->yiaddr, conf_proto, ses->mask);
+ iproute_del(serv->ifindex, ses->yiaddr, conf_proto, ses->mask, 0);
}
if (ses->dhcp_addr)
diff --git a/accel-pppd/ctrl/l2tp/l2tp.c b/accel-pppd/ctrl/l2tp/l2tp.c
index 55881b8d..cbb9de6b 100644
--- a/accel-pppd/ctrl/l2tp/l2tp.c
+++ b/accel-pppd/ctrl/l2tp/l2tp.c
@@ -3119,7 +3119,7 @@ static int rescode_get_data(const struct l2tp_attr_t *result_attr,
return 2;
*err_msg = _malloc(msglen + 1);
- if (err_msg) {
+ if (*err_msg) {
memcpy(*err_msg, resavp->error_msg, msglen);
(*err_msg)[msglen] = '\0';
}
diff --git a/accel-pppd/ctrl/pppoe/pppoe.c b/accel-pppd/ctrl/pppoe/pppoe.c
index 11a6ea1f..7ab20e35 100644
--- a/accel-pppd/ctrl/pppoe/pppoe.c
+++ b/accel-pppd/ctrl/pppoe/pppoe.c
@@ -1055,7 +1055,8 @@ static void pppoe_recv_PADI(struct pppoe_serv_t *serv, uint8_t *pack, int size)
pado->ppp_max_payload = ppp_max_payload;
pado->timer.expire = pado_timer;
- pado->timer.period = pado_delay;
+ pado->timer.expire_tv.tv_sec = pado_delay / 1000;
+ pado->timer.expire_tv.tv_usec = (pado_delay % 1000) * 1000;
triton_timer_add(&serv->ctx, &pado->timer, 0);