diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2024-05-01 18:31:07 +1000 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2024-05-02 16:13:44 +0200 |
commit | 2d16946bac152e251156258ac314a74f1984d421 (patch) | |
tree | 851b1d998216cfa91a984b878b3fc8ee63717494 /conf.c | |
parent | 6c4d26a3645b8cf58a62972f9e1b4e4af89971e0 (diff) | |
download | passt-2d16946bac152e251156258ac314a74f1984d421.tar passt-2d16946bac152e251156258ac314a74f1984d421.tar.gz passt-2d16946bac152e251156258ac314a74f1984d421.tar.bz2 passt-2d16946bac152e251156258ac314a74f1984d421.tar.lz passt-2d16946bac152e251156258ac314a74f1984d421.tar.xz passt-2d16946bac152e251156258ac314a74f1984d421.tar.zst passt-2d16946bac152e251156258ac314a74f1984d421.zip |
udp: Explicitly set checksum in guest-bound UDP headers
For IPv4, UDP checksums are optional and can just be set to 0.
udp_update_hdr4() ignores the checksum field entirely. Since these are set
to 0 during startup, this works as intended for now.
However, we'd like to share payload and UDP header buffers betweem IPv4 and
IPv6, which does calculate UDP checksums. Therefore, for robustness, we
should explicitly set the checksum field to 0 for guest-bound UDP packets.
In the tap_udp4_send() slow path, however, we do allow IPv4 UDP checksums
to be calculated as a compile time option. For consistency, use the same
thing in the udp_update_hdr4() path, which will typically initialize to 0,
but calculate a real checksum if configured to do so.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'conf.c')
0 files changed, 0 insertions, 0 deletions