ip->ip_proto = IPPROTO_UDP;
put_16aligned_be32(&ip->ip_src, bfd->ip_src);
put_16aligned_be32(&ip->ip_dst, bfd->ip_dst);
+ /* Checksum has already been zeroed by put_zeros call. */
ip->ip_csum = csum(ip, sizeof *ip);
udp = dp_packet_put_zeros(p, sizeof *udp);
icmp = dp_packet_put_zeros(p, l4_len);
icmp->icmp_type = ntohs(flow->tp_src);
icmp->icmp_code = ntohs(flow->tp_dst);
+ /* Checksum has already been zeroed by put_zeros call. */
icmp->icmp_csum = csum(icmp, ICMP_HEADER_LEN);
} else if (flow->nw_proto == IPPROTO_IGMP) {
struct igmp_header *igmp;
igmp->igmp_type = ntohs(flow->tp_src);
igmp->igmp_code = ntohs(flow->tp_dst);
put_16aligned_be32(&igmp->group, flow->igmp_group_ip4);
+ /* Checksum has already been zeroed by put_zeros call. */
igmp->igmp_csum = csum(igmp, IGMP_HEADER_LEN);
} else if (flow->nw_proto == IPPROTO_ICMPV6) {
struct icmp6_hdr *icmp;
ip = dp_packet_l3(p);
ip->ip_tot_len = htons(p->l4_ofs - p->l3_ofs + l4_len);
+ /* Checksum has already been zeroed by put_zeros call. */
ip->ip_csum = csum(ip, sizeof *ip);
} else if (flow->dl_type == htons(ETH_TYPE_IPV6)) {
struct ovs_16aligned_ip6_hdr *nh;
ip->ip_frag_off = (params->flow->tunnel.flags & FLOW_TNL_F_DONT_FRAGMENT) ?
htons(IP_DF) : 0;
+ /* Checksum has already been zeroed by eth_build_header. */
ip->ip_csum = csum(ip, sizeof *ip);
data->header_len += IP_HEADER_LEN;
struct ip_header *out_ip = dp_packet_l3(&pkt_out);
out_ip->ip_tot_len = htons(pkt_out.l4_ofs - pkt_out.l3_ofs + new_l4_size);
udp->udp_csum = 0;
+ /* Checksum needs to be initialized to zero. */
out_ip->ip_csum = 0;
out_ip->ip_csum = csum(out_ip, sizeof *out_ip);