/*
* Ensure that we send a sane reply to a request.
*/
- if (original) {
- packet->hdr.version = original->version;
- packet->hdr.type = original->type;
- packet->hdr.flags = original->flags; /* encrypted && single connection */
- packet->hdr.session_id = original->session_id;
+ {
+ fr_pair_t const *flags_vp;
+ /*
+ * Flags must be mutable so that the server
+ * can request single connection mode if
+ * this is configured for the client.
+ */
+ flags_vp = fr_pair_find_by_da_nested(vps, NULL, attr_tacacs_flags);
+
+ if (original) {
+ packet->hdr.version = original->version;
+ packet->hdr.type = original->type;
+ packet->hdr.flags = original->flags; /* encrypted && single connection */
+ packet->hdr.session_id = original->session_id;
+ }
+
+ if (flags_vp) packet->hdr.flags = flags_vp->vp_uint8;
}
/*
encode-proto -
match c0 02 02 00 e1 66 78 e6 00 00 00 13 02 59 f9 90 38 81 e1 bb 9d a6 13 93 fc 86 7e 4a 14 1c 24
+#
+# Authorization - Response: (Client <- Server)
+#
+# Flags = Single-Connect
+#
+# Regression test - Flags VP not respected
+#
+encode-proto Packet.Version-Major = Plus, Packet.Version-Minor = 0, Packet.Packet-Type = Authorization, Packet.Sequence-Number = 2, Packet.Flags = Single-Connect, Packet.Session-Id = 3781589222, Packet.Length = 19, Packet-Body-Type = Response, Authorization-Status = Pass-Add, Server-Message = "", Data = 0x, Argument-List = "addr=1.2.3.4"
+match c0 02 02 04 e1 66 78 e6 00 00 00 13 02 59 f9 90 38 81 e1 bb 9d a6 13 93 fc 86 7e 4a 14 1c 24
+
#
# Accounting - Request: (Client -> Server)
#
match Argument 3 length 32 overflows packet
count
-match 29
+match 31