]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
udp_input: remove a BSD stack relict
authorGleb Smirnoff <glebius@FreeBSD.org>
Thu, 28 Oct 2021 07:07:02 +0000 (00:07 -0700)
committerGleb Smirnoff <glebius@FreeBSD.org>
Wed, 3 Nov 2021 17:39:34 +0000 (10:39 -0700)
commit3358df2973251b4de690f197640eca5d794e0194
tree8bcb15c7fc19cd30604bf8778ed64e3b88958101
parentb788a226f6a274f9cb31014468700d0103974c07
udp_input: remove a BSD stack relict

I should had removed it 9 years ago in 8ad458a471ca.  That commit
left save_ip as a write-only variable.

With save_ip removed we got one case when IP header can be modified:
the calculation of IP checksum with zeroed out header.  This place
already has had a header saver char b[9].  However, the b[9] saver
didn't cover the ip_sum field, which we explicitly overwrite aliased
as (struct ipovly *)->ih_len.  This was fine in cb34210012d4e, since
checksum doesn't need to be restored if packet is consumed.  Now we
need to extend up to ip_sum field.

In collaboration with: ae
Differential revision: https://reviews.freebsd.org/D32719
sys/netinet/udp_usrreq.c