if (vp->da->parent == attr_tacacs_packet) break;
}
+ /*
+ * Force the correct header type, and randomly-placed
+ * status fields. But only if there's no code field.
+ * Only the unit tests pass a zero code field, as that's
+ * normally invalid. The unit tests ensure that all of
+ * the VPs are passed to encode a packet, and they all
+ * must be correct
+ */
+ if (code && (fr_tacacs_code_to_packet(packet, code) < 0)) return -1;
+
/*
* No "Packet" struct to encode. We MUST have an original packet to copy the various fields
* from.
return -1;
}
- /*
- * Force the correct header type, and randomly-placed
- * status fields. But only if there's no code field.
- * Only the unit tests pass a zero code field, as that's
- * normally invalid. The unit tests ensure that all of
- * the VPs are passed to encode a packet, and they all
- * must be correct
- */
- if (code && (fr_tacacs_code_to_packet(packet, code) < 0)) return -1;
-
/*
* The packet length we store in the header doesn't
* include the size of the header. But we tell the