projects
/
libradsec.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add rs_packet_add_avp() and use it.
[libradsec.git]
/
lib
/
radius
/
radpkt.c
diff --git
a/lib/radius/radpkt.c
b/lib/radius/radpkt.c
index
bb8f75e
..
d9486ea
100644
(file)
--- a/
lib/radius/radpkt.c
+++ b/
lib/radius/radpkt.c
@@
-871,7
+871,11
@@
ssize_t nr_packet_attr_append(RADIUS_PACKET *packet,
data_len = strlen(data);
}
data_len = strlen(data);
}
- packet->flags |= RS_PACKET_ENCODED; /* ignore any VPs */
+ /* We're going to mark the whole packet as encoded so we
+ better not have any unencoded value-pairs attached. */
+ if (packet->vps)
+ return -RSE_INVAL;
+ packet->flags |= RS_PACKET_ENCODED;
attr = packet->data + packet->length;
end = attr + packet->sizeof_data;
attr = packet->data + packet->length;
end = attr + packet->sizeof_data;