summaryrefslogtreecommitdiff
path: root/lib/radius/radpkt.c
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordberg.se>2013-05-17 10:50:11 +0200
committerLinus Nordberg <linus@nordberg.se>2013-05-17 10:50:11 +0200
commitbc7b85e8e4fa2e0e8d31bca161b2ad1a01ccafc5 (patch)
tree8b0808a9b8b72608134ae505d997ddb73dfdfaff /lib/radius/radpkt.c
parentb920acc2f69c099e8b9f1e97001f03b42d4c97c7 (diff)
parent9ac979d07ab5ddbc283daf3e469f7ae756c2a351 (diff)
Merge branch 'libradsec-add-avp-2' into libradsec
Conflicts: lib/Makefile.am
Diffstat (limited to 'lib/radius/radpkt.c')
-rw-r--r--lib/radius/radpkt.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/radius/radpkt.c b/lib/radius/radpkt.c
index bb8f75e..d9486ea 100644
--- 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);
}
- 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;