+ payload_len = GET_BE_U_2(ip6->ip6_plen);
+ /*
+ * RFC 1883 says:
+ *
+ * The Payload Length field in the IPv6 header must be set to zero
+ * in every packet that carries the Jumbo Payload option. If a
+ * packet is received with a valid Jumbo Payload option present and
+ * a non-zero IPv6 Payload Length field, an ICMP Parameter Problem
+ * message, Code 0, should be sent to the packet's source, pointing
+ * to the Option Type field of the Jumbo Payload option.
+ *
+ * Later versions of the IPv6 spec don't discuss the Jumbo Payload
+ * option.
+ *
+ * If the payload length is 0, we temporarily just set the total
+ * length to the remaining data in the packet (which, for Ethernet,
+ * could include frame padding, but if it's a Jumbo Payload frame,
+ * it shouldn't even be sendable over Ethernet, so we don't worry
+ * about that), so we can process the extension headers in order
+ * to *find* a Jumbo Payload hop-by-hop option and, when we've
+ * processed all the extension headers, check whether we found
+ * a Jumbo Payload option, and fail if we haven't.
+ */
+ if (payload_len != 0) {
+ len = payload_len + sizeof(struct ip6_hdr);
+ if (length < len)
+ ND_PRINT("truncated-ip6 - %u bytes missing!",
+ len - length);
+ } else
+ len = length + sizeof(struct ip6_hdr);
+
+ nh = GET_U_1(ip6->ip6_nxt);