summaryrefslogtreecommitdiff
path: root/accel-pppd/radius
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2016-06-07 20:41:14 +0300
committerDmitry Kozlov <xeb@mail.ru>2016-06-07 20:41:14 +0300
commit7fe9078e44b13c030e4c9ca55cc431f2811efc5a (patch)
tree8226aa14351319a221d5e62524ff05071b1502b4 /accel-pppd/radius
parent429ca0e6188594e5ccbce639d2d22576e5256e62 (diff)
parente3e804a0266840ef0a9cc13c4f6d1ac8fc68c676 (diff)
downloadaccel-ppp-7fe9078e44b13c030e4c9ca55cc431f2811efc5a.tar.gz
accel-ppp-7fe9078e44b13c030e4c9ca55cc431f2811efc5a.zip
Merge branch 'master' of ssh://git.code.sf.net/p/accel-ppp/code
Diffstat (limited to 'accel-pppd/radius')
-rw-r--r--accel-pppd/radius/radius.c2
-rw-r--r--accel-pppd/radius/serv.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/accel-pppd/radius/radius.c b/accel-pppd/radius/radius.c
index c5537086..c8e30ebd 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);
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;
}