From 492e0d46037630e0654210d8adea6b83d61dab58 Mon Sep 17 00:00:00 2001 From: Mihail Vasilev Date: Mon, 30 May 2016 10:00:48 +0000 Subject: Fixup - don't divide on unchecked values. Multiply instead. --- accel-pppd/radius/serv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'accel-pppd/radius') diff --git a/accel-pppd/radius/serv.c b/accel-pppd/radius/serv.c index 9b59d04b..d40bff10 100644 --- a/accel-pppd/radius/serv.c +++ b/accel-pppd/radius/serv.c @@ -69,7 +69,7 @@ static struct rad_server_t *__rad_server_get(int type, struct rad_server_t *excl if ((s->backup < s0->backup) || ((s->backup == s0->backup) && - ((s->client_cnt[0] + s->client_cnt[1])/s->weight < (s0->client_cnt[0] + s0->client_cnt[1])/s0->weight))) + ((s->client_cnt[0] + s->client_cnt[1])*s0->weight < (s0->client_cnt[0] + s0->client_cnt[1])*s->weight))) s0 = s; } -- cgit v1.2.3 From e3e804a0266840ef0a9cc13c4f6d1ac8fc68c676 Mon Sep 17 00:00:00 2001 From: Guillaume Nault Date: Tue, 31 May 2016 21:43:48 +0200 Subject: radius: initialise ipv6db addresses completely The 'installed' bit of the allocated ipv6db_addr_t structure needs to be initialised. This is because ap_session_ifdown() reads this bit to know if the address or route needs to be removed from the kernel. The 'installed' bit is set by ap_session_accounting_started() and the ND and DHCPV6 protocol handlers, but disconnection could happen before these steps. Signed-off-by: Guillaume Nault --- accel-pppd/radius/radius.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'accel-pppd/radius') diff --git a/accel-pppd/radius/radius.c b/accel-pppd/radius/radius.c index c8eaf953..4c32375c 100644 --- a/accel-pppd/radius/radius.c +++ b/accel-pppd/radius/radius.c @@ -216,12 +216,14 @@ int rad_proc_attrs(struct rad_req_t *req) break; case Framed_IPv6_Prefix: a = _malloc(sizeof(*a)); + memset(a, 0, sizeof(*a)); a->prefix_len = attr->val.ipv6prefix.len; a->addr = attr->val.ipv6prefix.prefix; list_add_tail(&a->entry, &rpd->ipv6_addr.addr_list); break; case Delegated_IPv6_Prefix: a = _malloc(sizeof(*a)); + memset(a, 0, sizeof(*a)); a->prefix_len = attr->val.ipv6prefix.len; a->addr = attr->val.ipv6prefix.prefix; list_add_tail(&a->entry, &rpd->ipv6_dp.prefix_list); -- cgit v1.2.3