diff options
| author | Denys Fedoryshchenko <denys.f@collabora.com> | 2026-08-27 09:14:05 +0300 |
|---|---|---|
| committer | Denys Fedoryshchenko <denys.f@collabora.com> | 2026-10-06 02:18:41 +0300 |
| commit | d8084108cc750962dafcd3716f5d243de2e56418 (patch) | |
| tree | 0264d8afbb41d018df4de56be870d2658def3b14 /accel-pppd/radius | |
| parent | 2600050acd74bf6cea320e8d5f3c7ae09568b062 (diff) | |
| download | accel-ppp-d8084108cc750962dafcd3716f5d243de2e56418.tar.gz accel-ppp-d8084108cc750962dafcd3716f5d243de2e56418.zip | |
ipv6: use a dedicated type for per-session DNS
DNS-Server-IPv6-Address carries a full IPv6 address, so storing it in
ipv6db_addr_t also carried an unused prefix length and flags. Introduce
dedicated DNS list and address types so the representation matches the data.
Suggested-by: Vladislav Grishenko <566150+themiron@users.noreply.github.com>
Link: https://github.com/accel-ppp/accel-ppp/commit/4f562467dbdf819395e138617c2a057e02595b9e#r197215804
Diffstat (limited to 'accel-pppd/radius')
| -rw-r--r-- | accel-pppd/radius/radius.c | 11 | ||||
| -rw-r--r-- | accel-pppd/radius/radius_p.h | 3 |
2 files changed, 7 insertions, 7 deletions
diff --git a/accel-pppd/radius/radius.c b/accel-pppd/radius/radius.c index 89f1e398..544be09f 100644 --- a/accel-pppd/radius/radius.c +++ b/accel-pppd/radius/radius.c @@ -497,7 +497,7 @@ err: static void free_ipv6_dns(struct radius_pd_t *rpd) { - struct ipv6db_addr_t *a; + struct ipv6_dns_addr_t *a; while (!list_empty(&rpd->ipv6_dns.addr_list)) { a = list_entry(rpd->ipv6_dns.addr_list.next, typeof(*a), entry); @@ -512,6 +512,7 @@ int rad_proc_attrs(struct rad_req_t *req) struct ev_dns_t dns = {}; struct rad_attr_t *attr; struct ipv6db_addr_t *a; + struct ipv6_dns_addr_t *dns6; int dns6_count = -1; int res = 0; struct radius_pd_t *rpd = req->rpd; @@ -643,11 +644,9 @@ int rad_proc_attrs(struct rad_req_t *req) dns6_count++; break; } - a = _malloc(sizeof(*a)); - memset(a, 0, sizeof(*a)); - a->prefix_len = 128; - a->addr = attr->val.ipv6addr; - list_add_tail(&a->entry, &rpd->ipv6_dns.addr_list); + dns6 = _malloc(sizeof(*dns6)); + dns6->addr = attr->val.ipv6addr; + list_add_tail(&dns6->entry, &rpd->ipv6_dns.addr_list); dns6_count++; break; case NAS_Port: diff --git a/accel-pppd/radius/radius_p.h b/accel-pppd/radius/radius_p.h index e4b84740..354d54fc 100644 --- a/accel-pppd/radius/radius_p.h +++ b/accel-pppd/radius/radius_p.h @@ -9,6 +9,7 @@ #include "radius.h" #include "ppp.h" #include "ipdb.h" +#include "ipv6_dns.h" #include "pwdb.h" struct rad_server_t; @@ -65,7 +66,7 @@ struct radius_pd_t { struct ipv4db_item_t ipv4_addr; struct ipv6db_item_t ipv6_addr; struct ipv6db_prefix_t ipv6_dp; - struct ipv6db_item_t ipv6_dns; + struct ipv6_dns_t ipv6_dns; int acct_interim_interval; int acct_interim_jitter; |
