Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c7828be8 authored by Subash Abhinov Kasiviswanathan's avatar Subash Abhinov Kasiviswanathan
Browse files

Revert "net: tun: Implement TUN_NOCHECKSUM"



This reverts commit commit 710d10e1 ("net: tun: Implement
TUN_NOCHECKSUM").

This change is no longer needed as it may blindly skip checksum
validation for packets whose checksum may not have been validated
earlier in the stack.

Hardware supports checksum offload for IPv4 / IPv6 TCP / UDP packets
only. The original commit would have allowed ICMP / ICMPv6 /
fragmented packets to skip checksum validation completely in the
network stack which is incorrect.

Change-Id: I88b52329edc89e252f1d55c9741eda4c8e3cffd8
Signed-off-by: default avatarSubash Abhinov Kasiviswanathan <subashab@codeaurora.org>
parent 51b325be
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -1112,8 +1112,7 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile,
			kfree_skb(skb);
			return -EINVAL;
		}
	} else if (tun->flags & TUN_NOCHECKSUM)
		skb->ip_summed = CHECKSUM_UNNECESSARY;
	}

	if (!(tun->flags & TUN_NO_PI))
		if (pi.flags & htons(CHECKSUM_UNNECESSARY))
@@ -1961,10 +1960,9 @@ static long __tun_chr_ioctl(struct file *file, unsigned int cmd,
	case TUNSETNOCSUM:
		/* Disable/Enable checksum */

		if (arg)
			tun->flags |= TUN_NOCHECKSUM;
		else
			tun->flags &= ~TUN_NOCHECKSUM;
		/* [unimplemented] */
		tun_debug(KERN_INFO, tun, "ignored: set checksum %s\n",
			  arg ? "disabled" : "enabled");
		break;

	case TUNSETPERSIST: