{
struct ip6_hdr *nh;
int nh_len = sizeof(struct ip6_hdr);
- int payload_len;
ovs_be32 tc_flow;
int nexthdr;
nh = packet->data;
nexthdr = nh->ip6_nxt;
- payload_len = ntohs(nh->ip6_plen);
flow->ipv6_src = nh->ip6_src;
flow->ipv6_dst = nh->ip6_dst;
flow->nw_tos = (ntohl(tc_flow) >> 4) & IP_DSCP_MASK;
flow->nw_proto = IPPROTO_NONE;
- /* We don't process jumbograms. */
- if (!payload_len) {
- return -EINVAL;
- }
-
- if (packet->size < sizeof *nh + payload_len) {
- return -EINVAL;
- }
-
while (1) {
if ((nexthdr != IPPROTO_HOPOPTS)
&& (nexthdr != IPPROTO_ROUTING)
}
}
- /* The payload length claims to be smaller than the size of the
- * headers we've already processed. */
- if (payload_len < nh_len - sizeof *nh) {
- return -EINVAL;
- }
-
flow->nw_proto = nexthdr;
return nh_len;
}
packet->l7 = b.data;
}
} else if (flow->nw_proto == IPPROTO_ICMPV6) {
- int icmp_len = ntohs(nh->ip6_plen) + sizeof *nh - nh_len;
- if (parse_icmpv6(&b, flow, icmp_len)) {
+ if (parse_icmpv6(&b, flow, b.size)) {
packet->l7 = b.data;
}
}