aboutgitcodebugslistschat
path: root/tap.h
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2024-03-08 17:53:24 +1100
committerStefano Brivio <sbrivio@redhat.com>2024-03-14 16:57:37 +0100
commit4db947d17c8c7dac3b344c8ce0a266f7be159200 (patch)
tree5db310fa193a86befdf4df2ff940aa6aeed59f82 /tap.h
parent1ebe787fe460eb83d67792b6af1b02f4f555dc86 (diff)
downloadpasst-4db947d17c8c7dac3b344c8ce0a266f7be159200.tar
passt-4db947d17c8c7dac3b344c8ce0a266f7be159200.tar.gz
passt-4db947d17c8c7dac3b344c8ce0a266f7be159200.tar.bz2
passt-4db947d17c8c7dac3b344c8ce0a266f7be159200.tar.lz
passt-4db947d17c8c7dac3b344c8ce0a266f7be159200.tar.xz
passt-4db947d17c8c7dac3b344c8ce0a266f7be159200.tar.zst
passt-4db947d17c8c7dac3b344c8ce0a266f7be159200.zip
tap: Implement tap_send() "slow path" in terms of fast path
Most times we send frames to the guest it goes via tap_send_frames(). However "slow path" protocols - ARP, ICMP, ICMPv6, DHCP and DHCPv6 - go via tap_send(). As well as being a semantic duplication, tap_send() contains at least one serious problem: it doesn't properly handle short sends, which can be fatal on the qemu socket connection, since frame boundaries will get out of sync. Rewrite tap_send() to call tap_send_frames(). While we're there, rename it tap_send_single() for clarity. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'tap.h')
-rw-r--r--tap.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/tap.h b/tap.h
index c45aab3..aa3b1af 100644
--- a/tap.h
+++ b/tap.h
@@ -72,7 +72,7 @@ void tap_udp6_send(const struct ctx *c,
void tap_icmp6_send(const struct ctx *c,
const struct in6_addr *src, const struct in6_addr *dst,
const void *in, size_t len);
-int tap_send(const struct ctx *c, const void *data, size_t len);
+void tap_send_single(const struct ctx *c, const void *data, size_t len);
size_t tap_send_frames(const struct ctx *c, const struct iovec *iov,
size_t bufs_per_frame, size_t nframes);
void eth_update_mac(struct ethhdr *eh,