If an attribute is unknown, it's type MUST be octets. AND we can
encode it. In fact, we generally MUST encode it, as the admin
is trying to work around stupid vendor issues.
<cough> SUPERMICRO </cough>
}
/*
- * Unknown attributes can't be encoded, as we don't
- * know how to encode them!
+ * Unknown attributes can be encoded, BUT
+ * they must be of type "octets".
*/
- tmpl_unknown(vpt)->flags.internal = 1;
+ fr_assert(tmpl_unknown(vpt)->type == FR_TYPE_OCTETS);
tmpl_da_set(vpt, tmpl_unknown(vpt));
p += slen;
--- /dev/null
+Sent Access-Request Id 123 from 0.0.0.0:1234 to 127.0.0.1:12340 length 51
+ Cleartext-Password = "hello"
+ User-Name = "bob"
+ User-Password = "hello"
+ NAS-Identifier = "auth_4"
+Received Access-Accept Id 123 from 127.0.0.1:12340 to 0.0.0.0:1234 via lo length 47
+ Class = 0x483d342c493d34
+ Attr-26 = 0x483d342c493d34
+ Attr-26 = 0x483d342c493d43
--- /dev/null
+#
+# ARGV: -i 123 -c 1 -x -F
+#
+User-Name = "bob",
+User-Password = "hello"
+NAS-Identifier = "auth_4"
}
recv Access-Request {
+ #
+ # Ensure that we can send unknown attributes back.
+ #
+ if (&NAS-Identifier == "auth_4") {
+ update reply {
+ &Class := 0x483d342c493d34
+ }
+
+ update reply {
+ &Attr-26 := &reply:Class
+ &Attr-26 += 0x483d342c493d43
+ }
+ }
+
if (&User-Name == "bob") {
accept
} else {
reject
}
+
}
send Access-Accept {