summaryrefslogtreecommitdiff
path: root/accel-pppd/radius
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2018-04-12 18:26:55 +0300
committerDmitry Kozlov <xeb@mail.ru>2018-04-12 18:26:55 +0300
commit1eaf9b4fc806c233e66a86e80705e1e580029599 (patch)
treeb77904292f358b780eaaf81aa310593c565fc5f8 /accel-pppd/radius
parentb9c3e454c13baba224cab6644827fa2f11edddbe (diff)
downloadaccel-ppp-1eaf9b4fc806c233e66a86e80705e1e580029599.tar.gz
accel-ppp-1eaf9b4fc806c233e66a86e80705e1e580029599.zip
radius: initialize rad_attr_t::raw field on newly inserted attributes
Diffstat (limited to 'accel-pppd/radius')
-rw-r--r--accel-pppd/radius/packet.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/accel-pppd/radius/packet.c b/accel-pppd/radius/packet.c
index f6971dc5..e33e88ef 100644
--- a/accel-pppd/radius/packet.c
+++ b/accel-pppd/radius/packet.c
@@ -435,6 +435,7 @@ int __export rad_packet_add_int(struct rad_packet_t *pack, const char *vendor_na
ra->attr = attr;
ra->len = 4;
ra->val.integer = val;
+ ra->raw = &ra->val;
list_add_tail(&ra->entry, &pack->attrs);
pack->len += (vendor_name ? 8 : 2) + 4;
@@ -498,6 +499,8 @@ int __export rad_packet_add_octets(struct rad_packet_t *pack, const char *vendor
memcpy(ra->val.octets, val, len);
}
+ ra->raw = ra->val.octets;
+
list_add_tail(&ra->entry, &pack->attrs);
pack->len += (vendor_name ? 8 : 2) + len;
@@ -522,6 +525,8 @@ int __export rad_packet_change_octets(struct rad_packet_t *pack, const char *ven
return -1;
}
+ ra->raw = ra->val.octets;
+
pack->len += len - ra->len;
ra->len = len;
}
@@ -575,6 +580,7 @@ int __export rad_packet_add_str(struct rad_packet_t *pack, const char *vendor_na
}
memcpy(ra->val.string, val, len);
ra->val.string[len] = 0;
+ ra->raw = ra->val.string;
list_add_tail(&ra->entry, &pack->attrs);
pack->len += (vendor_name ? 8 : 2) + len;
@@ -599,6 +605,8 @@ int __export rad_packet_change_str(struct rad_packet_t *pack, const char *vendor
return -1;
}
+ ra->raw = ra->val.string;
+
pack->len += len - ra->len;
ra->len = len;
}
@@ -645,6 +653,7 @@ int __export rad_packet_add_val(struct rad_packet_t *pack, const char *vendor_na
ra->attr = attr;
ra->len = 4;
ra->val = v->val;
+ ra->raw = &ra->val;
list_add_tail(&ra->entry, &pack->attrs);
pack->len += (vendor_name ? 8 : 2) + 4;
@@ -705,6 +714,7 @@ int rad_packet_add_ifid(struct rad_packet_t *pack, const char *vendor_name, cons
ra->attr = attr;
ra->len = 8;
ra->val.ifid = ifid;
+ ra->raw = &ra->val;
list_add_tail(&ra->entry, &pack->attrs);
pack->len += (vendor_name ? 8 : 2) + 8;
@@ -743,6 +753,7 @@ int rad_packet_add_ipv6prefix(struct rad_packet_t *pack, const char *vendor_name
ra->len = 18;
ra->val.ipv6prefix.len = len;
ra->val.ipv6prefix.prefix = *prefix;
+ ra->raw = &ra->val;
list_add_tail(&ra->entry, &pack->attrs);
pack->len += (vendor_name ? 8 : 2) + 18;