lib/tc: Remove unnecessary icmp recalculation
ICMP checksum is calculated from ICMP headers and data, so hardware doesn't
need to calculate it again because we only rewrite IP headers.
@@ -1275,7 +1275,7 @@ csum_update_flag(struct tc_flower *flower,
* eth(dst=<mac>),eth_type(0x0800) actions=set(ipv4(src=<new_ip>))
* we need to force a more specific flow as this can, for example,
* need a recalculation of icmp checksum if the packet that passes
- * is icmp and tcp checksum if its tcp. */
+ * is ICMPv6 and tcp checksum if its tcp. */
switch (htype) {
case TCA_PEDIT_KEY_EX_HDR_TYPE_IP4:
@@ -1290,8 +1290,9 @@ csum_update_flag(struct tc_flower *flower,
} else if (flower->key.ip_proto == IPPROTO_UDP) {
flower->needs_full_ip_proto_mask = true;
flower->csum_update_flags |= TCA_CSUM_UPDATE_FLAG_UDP;
- } else if (flower->key.ip_proto == IPPROTO_ICMP
- || flower->key.ip_proto == IPPROTO_ICMPV6) {
+ } else if (flower->key.ip_proto == IPPROTO_ICMP) {
+ flower->needs_full_ip_proto_mask = true;
+ } else if (flower->key.ip_proto == IPPROTO_ICMPV6) {
flower->needs_full_ip_proto_mask = true;
flower->csum_update_flags |= TCA_CSUM_UPDATE_FLAG_ICMP;
} else {
