+ /*
+ * Not an extension header; hand off to the
+ * IP protocol demuxer.
+ */
+ if (found_jumbo) {
+ /*
+ * We saw a Jumbo Payload option.
+ * Set the length to the payload length
+ * plus the IPv6 header length, and
+ * change the snapshot length accordingly.
+ *
+ * But make sure it's not shorter than
+ * the total number of bytes we've
+ * processed so far.
+ */
+ len = payload_len + sizeof(struct ip6_hdr);
+ if (len < total_advance)
+ goto trunc;
+ if (len > length) {
+ ND_PRINT("[header+payload length %u > length %u]",
+ len, length);
+ nd_print_invalid(ndo);
+ ND_PRINT(" ");
+ }
+ nd_change_snaplen(ndo, bp, len);
+
+ /*
+ * Now subtract the length of the IPv6
+ * header plus extension headers to get
+ * the payload length.
+ */
+ len -= total_advance;
+ } else {
+ /*
+ * We didn't see a Jumbo Payload option;
+ * was the payload length zero?
+ */
+ if (payload_len == 0) {
+ /*
+ * Yes. If we found an extension
+ * header, treat that as a truncated
+ * packet header, as there was
+ * no payload to contain an
+ * extension header.
+ */
+ if (found_extension_header)
+ goto trunc;
+
+ /*
+ * OK, we didn't see any extension
+ * header, but that means we have
+ * no payload, so set the length
+ * to the IPv6 header length,
+ * and change the snapshot length
+ * accordingly.
+ */
+ len = sizeof(struct ip6_hdr);
+ nd_change_snaplen(ndo, bp, len);
+
+ /*
+ * Now subtract the length of
+ * the IPv6 header plus extension
+ * headers (there weren't any, so
+ * that's just the IPv6 header
+ * length) to get the payload length.
+ */
+ len -= total_advance;
+ }
+ }
+ ip_demux_print(ndo, cp, len, 6, fragmented,
+ GET_U_1(ip6->ip6_hlim), nh, bp);
+ nd_pop_packet_info(ndo);