+ }
+
+ /*
+ * We now have the final length/type field.
+ */
+ if (length_type <= MAX_ETHERNET_LENGTH_VAL) {
+ /*
+ * It's a length field, containing the length of the
+ * remaining payload; use it as such, as long as
+ * it's not too large (bigger than the actual payload).
+ */
+ if (length_type < length) {
+ length = length_type;
+ if (caplen > length)
+ caplen = length;
+ }
+
+ /*
+ * Cut off the snapshot length to the end of the
+ * payload.
+ */
+ if (!nd_push_snaplen(ndo, p, length)) {
+ (*ndo->ndo_error)(ndo, S_ERR_ND_MEM_ALLOC,
+ "%s: can't push snaplen on buffer stack", __func__);
+ }
+
+ if (ndo->ndo_eflag) {
+ ND_PRINT("802.3");
+ if (!printed_length)
+ ND_PRINT(", length %u: ", length);
+ }
+
+ /*
+ * An LLC header follows the length. Print that and
+ * higher layers.
+ */
+ llc_hdrlen = llc_print(ndo, p, length, caplen, &src, &dst);
+ if (llc_hdrlen < 0) {
+ /* packet type not known, print raw packet */
+ if (!ndo->ndo_suppress_default_print)
+ ND_DEFAULTPRINT(p, caplen);
+ llc_hdrlen = -llc_hdrlen;
+ }
+ hdrlen += llc_hdrlen;
+ nd_pop_packet_info(ndo);