- u32 udp_offset[N];
- u8 is_tcp_udp[N];
- xN is_tcp_udp[n] =
- ip6_next_proto_is_tcp_udp (b[n], ip[n], &udp_offset[n]);
- i16 len_diff[N] = { 0 };
- xN if (PREDICT_TRUE (is_tcp_udp[n]))
+ u32 udp_offset[2];
+ u8 is_tcp_udp[2];
+ is_tcp_udp[0] =
+ ip6_next_proto_is_tcp_udp (b[0], ip[0], &udp_offset[0]);
+ is_tcp_udp[1] =
+ ip6_next_proto_is_tcp_udp (b[1], ip[1], &udp_offset[1]);
+ i16 len_diff[2] = { 0 };
+ if (PREDICT_TRUE (is_tcp_udp[0]))
+ {
+ udp_header_t *udp =
+ (udp_header_t *) ((u8 *) ip[0] + udp_offset[0]);
+ good_l4_csum[0] |= type[0] == IP_BUILTIN_PROTOCOL_UDP
+ && udp->checksum == 0;
+ /* optimistically verify UDP length. */
+ u16 ip_len, udp_len;
+ ip_len = clib_net_to_host_u16 (ip[0]->payload_length);
+ udp_len = clib_net_to_host_u16 (udp->length);
+ len_diff[0] = ip_len - udp_len;
+ }
+ if (PREDICT_TRUE (is_tcp_udp[1]))