aboutgitcodebugslistschat
path: root/tcp.c
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2024-03-08 17:53:25 +1100
committerStefano Brivio <sbrivio@redhat.com>2024-03-14 16:57:43 +0100
commitd3eb0d7b59f6a1f3e78efc04c44e1c700b907332 (patch)
treedec4b921ed3b6bcc76fa239ab399a6a1ddf5960c /tcp.c
parent4db947d17c8c7dac3b344c8ce0a266f7be159200 (diff)
downloadpasst-d3eb0d7b59f6a1f3e78efc04c44e1c700b907332.tar
passt-d3eb0d7b59f6a1f3e78efc04c44e1c700b907332.tar.gz
passt-d3eb0d7b59f6a1f3e78efc04c44e1c700b907332.tar.bz2
passt-d3eb0d7b59f6a1f3e78efc04c44e1c700b907332.tar.lz
passt-d3eb0d7b59f6a1f3e78efc04c44e1c700b907332.tar.xz
passt-d3eb0d7b59f6a1f3e78efc04c44e1c700b907332.tar.zst
passt-d3eb0d7b59f6a1f3e78efc04c44e1c700b907332.zip
tap: Rename tap_iov_{base,len}
These two functions are typically used to calculate values to go into the iov_base and iov_len fields of a struct iovec. They don't have to be used for that, though. Rename them in terms of what they actually do: calculate the base address and total length of the complete frame, including both L2 and tap specific headers. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'tcp.c')
-rw-r--r--tcp.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/tcp.c b/tcp.c
index 9d90108..a1860d1 100644
--- a/tcp.c
+++ b/tcp.c
@@ -1014,10 +1014,10 @@ static void tcp_sock4_iov_init(const struct ctx *c)
}
for (i = 0, iov = tcp4_l2_iov; i < TCP_FRAMES_MEM; i++, iov++)
- iov->iov_base = tap_iov_base(c, &tcp4_l2_buf[i].taph);
+ iov->iov_base = tap_frame_base(c, &tcp4_l2_buf[i].taph);
for (i = 0, iov = tcp4_l2_flags_iov; i < TCP_FRAMES_MEM; i++, iov++)
- iov->iov_base = tap_iov_base(c, &tcp4_l2_flags_buf[i].taph);
+ iov->iov_base = tap_frame_base(c, &tcp4_l2_flags_buf[i].taph);
}
/**
@@ -1045,10 +1045,10 @@ static void tcp_sock6_iov_init(const struct ctx *c)
}
for (i = 0, iov = tcp6_l2_iov; i < TCP_FRAMES_MEM; i++, iov++)
- iov->iov_base = tap_iov_base(c, &tcp6_l2_buf[i].taph);
+ iov->iov_base = tap_frame_base(c, &tcp6_l2_buf[i].taph);
for (i = 0, iov = tcp6_l2_flags_iov; i < TCP_FRAMES_MEM; i++, iov++)
- iov->iov_base = tap_iov_base(c, &tcp6_l2_flags_buf[i].taph);
+ iov->iov_base = tap_frame_base(c, &tcp6_l2_flags_buf[i].taph);
}
/**
@@ -1454,14 +1454,14 @@ static size_t tcp_l2_buf_fill_headers(const struct ctx *c,
ip_len = tcp_fill_headers4(c, conn, &b->iph, &b->th, plen,
check, seq);
- tlen = tap_iov_len(c, &b->taph, ip_len);
+ tlen = tap_frame_len(c, &b->taph, ip_len);
} else {
struct tcp6_l2_buf_t *b = (struct tcp6_l2_buf_t *)p;
ip_len = tcp_fill_headers6(c, conn, &b->ip6h, &b->th, plen,
seq);
- tlen = tap_iov_len(c, &b->taph, ip_len);
+ tlen = tap_frame_len(c, &b->taph, ip_len);
}
return tlen;