]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
gif(4): Revert in{,6}_gif_output() misalignment handling
authorMarius Strobl <marius@FreeBSD.org>
Wed, 19 Jul 2023 17:17:43 +0000 (19:17 +0200)
committerMarius Strobl <marius@FreeBSD.org>
Wed, 26 Jul 2023 11:14:22 +0000 (13:14 +0200)
commite82d7b2952afaf9625a3d7b05d03c43c1d3e7d9c
tree1a4ef112a1c3e7c7074abac5de8a4dcde48468a7
parentbb255cee93828c6a885057d9227efe698a9a6b44
gif(4): Revert in{,6}_gif_output() misalignment handling

The code added in c89c8a1029860182eece5d51ec09119b9500e5a1 in order
to compensate possible misalignment caused by prepending the IP4/6
header with an EtherIP one got broken at some point by a rewrite of
gif(4). For better or worse, 8018ac153f7671699ca008f31c0fad9caef2f531
relaxed the alignment of struct ip from 32 bit to 16 bit, though. As
a result, a 16 bit offset of the IPv4 header induced by the addition
of the 16 bit EtherIP one no longer is a problem in the first place.
The alignment of struct ip6_hdr currently is even only 8 bit, making
it even less problematic with regards to possible misalignment.
Thus, remove the code for handling misalignment in in{,6}_gif_output()
altogether again.
While at it, replace the 3 bcopy(9) calls in gif(4) with memcpy(9) as
there's no need to handle overlap here.
sys/net/if_gif.c
sys/net/if_gif.h
sys/netinet/in_gif.c
sys/netinet6/in6_gif.c