diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2024-05-01 16:53:52 +1000 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2024-05-02 16:13:31 +0200 |
commit | 35598995869b0966eb97a16411d6ba5053005431 (patch) | |
tree | 6645dfd2dc3db6c8d311be30e60f68b01ed961fa /tap.c | |
parent | 40f8b2976ab09c77b14238d6eabaa7793d5365e4 (diff) | |
download | passt-35598995869b0966eb97a16411d6ba5053005431.tar passt-35598995869b0966eb97a16411d6ba5053005431.tar.gz passt-35598995869b0966eb97a16411d6ba5053005431.tar.bz2 passt-35598995869b0966eb97a16411d6ba5053005431.tar.lz passt-35598995869b0966eb97a16411d6ba5053005431.tar.xz passt-35598995869b0966eb97a16411d6ba5053005431.tar.zst passt-35598995869b0966eb97a16411d6ba5053005431.zip |
iov: Helper macro to construct iovs covering existing variables or fields
Laurent's recent changes mean we use IO vectors much more heavily in the
TCP code. In many of those cases, and few others around the code base,
individual iovs of these vectors are constructed to exactly cover existing
variables or fields. We can make initializing such iovs shorter and
clearer with a macro for the purpose.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'tap.c')
-rw-r--r-- | tap.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -79,8 +79,7 @@ void tap_send_single(const struct ctx *c, const void *data, size_t l2len) size_t iovcnt = 0; if (c->mode == MODE_PASST) { - iov[iovcnt].iov_base = &vnet_len; - iov[iovcnt].iov_len = sizeof(vnet_len); + iov[iovcnt] = IOV_OF_LVALUE(vnet_len); iovcnt++; } |