summaryrefslogtreecommitdiff
path: root/accel-pppd/extra
diff options
context:
space:
mode:
authorDmitriy Eshenko <dmitriy.eshenko@accel-ppp.org>2024-10-04 22:37:59 +0300
committerGitHub <noreply@github.com>2024-10-04 22:37:59 +0300
commitaa551fe44a5801d8d5963e43791d5b5f959c3e32 (patch)
tree34b26c4d328bcde684a073155eabfc433c20915f /accel-pppd/extra
parent00b8dee7c3635e2a85968b2dae0a6712b20a34bc (diff)
parentf457628041ca77a37afd791c0f6d7330fca1e540 (diff)
downloadaccel-ppp-aa551fe44a5801d8d5963e43791d5b5f959c3e32.tar.gz
accel-ppp-aa551fe44a5801d8d5963e43791d5b5f959c3e32.zip
Merge pull request #171 from ZBoris7/master
pppd_compat: add Framed-Interface-Id attribute support in radattr
Diffstat (limited to 'accel-pppd/extra')
-rw-r--r--accel-pppd/extra/pppd_compat.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/accel-pppd/extra/pppd_compat.c b/accel-pppd/extra/pppd_compat.c
index 040e7d90..12363cd4 100644
--- a/accel-pppd/extra/pppd_compat.c
+++ b/accel-pppd/extra/pppd_compat.c
@@ -518,6 +518,10 @@ static void write_radattr(struct pppd_compat_pd *pd, struct rad_packet_t *pack)
int fd, i;
in_addr_t addr;
char ip_str[50];
+ union {
+ uint64_t ifid;
+ uint16_t u16[4];
+ } ifid_u;
if (ses->state == AP_STATE_ACTIVE) {
sprintf(fname1, "%s.%s", conf_radattr_prefix, ses->ifname);
@@ -572,6 +576,10 @@ static void write_radattr(struct pppd_compat_pd *pd, struct rad_packet_t *pack)
inet_ntop(AF_INET6, &attr->val.ipv6addr, ip_str, sizeof(ip_str));
fprintf(f, "%s\n", ip_str);
break;
+ case ATTR_TYPE_IFID:
+ ifid_u.ifid = attr->val.ifid;
+ fprintf(f, "%x:%x:%x:%x\n", ntohs(ifid_u.u16[0]), ntohs(ifid_u.u16[1]), ntohs(ifid_u.u16[2]), ntohs(ifid_u.u16[3]));
+ break;
}
}
fclose(f);