Skip to contentSkip to conversation

Adding SO_PEEK_OFF for TCPv6

PATCH Applied [email protected] 3 participants 5 messages Aug 28, 2024 – Aug 30, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

v3 cover Adding SO_PEEK_OFF for TCPv6

From: Jon Maloy <[email protected]>

Adding SO_PEEK_OFF for TCPv6 and selftest for both TCPv4 and TCPv6

Jon Maloy (2):
tcp: add SO_PEEK_OFF socket option tor TCPv6
selftests: add selftest for tcp SO_PEEK_OFF support

 net/ipv6/af_inet6.c                           |   1 +
 tools/testing/selftests/net/Makefile          |   1 +
 tools/testing/selftests/net/tcp_so_peek_off.c | 183 ++++++++++++++++++
 3 files changed, 185 insertions(+)
 create mode 100644 tools/testing/selftests/net/tcp_so_peek_off.c
Signature · 1 line
2.45.2
#1 lore raw

PATCH v3 1/2 tcp: add SO_PEEK_OFF socket option tor TCPv6

From: Jon Maloy <[email protected]>

When doing further testing of the recently added SO_PEEK_OFF feature for TCP I realized I had omitted to add it for TCP/IPv6.

I do that here.

Fixes 05ea491641d3 ("tcp: add support for SO_PEEK_OFF socket option")

---
v2: Removed redundant whitespace between "Fixes" and
"Signed-off-by" lines. Based on feedback from J. Kicinski.
v3: Rephrased commit log to make it clear how the TCP/IPv6 omission
was discovered. Based on feedback from J. Kicinski.

---
 net/ipv6/af_inet6.c | 1 +
 1 file changed, 1 insertion(+)
net/ipv6/af_inet6.c +1 -0
index 90d2c7e3f5e9..ba69b86f1c7d 100644
@@ -708,6 +708,7 @@ const struct proto_ops inet6_stream_ops = {
 	.splice_eof	   = inet_splice_eof,
 	.sendmsg_locked    = tcp_sendmsg_locked,
 	.splice_read	   = tcp_splice_read,
+	.set_peek_off      = sk_set_peek_off,
 	.read_sock	   = tcp_read_sock,
 	.read_skb	   = tcp_read_skb,
 	.peek_len	   = tcp_peek_len,
Signature · 1 line
2.45.2
Reviewed-by on v3 1/2
#2 lore raw

Re: [net-next, v3 1/2] tcp: add SO_PEEK_OFF socket option tor TCPv6

Quoted 6 lines · On Thu, Aug 29, 2024 at 2:38 AM <[email protected]> wrote:

From: Jon Maloy <[email protected]>

When doing further testing of the recently added SO_PEEK_OFF feature for TCP I realized I had omitted to add it for TCP/IPv6.

Quoted 8 lines

I do that here.

Fixes 05ea491641d3 ("tcp: add support for SO_PEEK_OFF socket option")
#3 lore raw

PATCH v3 2/2 selftests: add selftest for tcp SO_PEEK_OFF support

In reply to [email protected]

From: Jon Maloy <[email protected]>

We add a selftest to check that the new feature added in commit 05ea491641d3 ("tcp: add support for SO_PEEK_OFF socket option") works correctly.

---
v2: Made correction based on Jason Xing's comment.
v3: Removed redundant whitespace at end of file.
Based on comment from Jakub Kicinski.

---
 tools/testing/selftests/net/Makefile          |   1 +
 tools/testing/selftests/net/tcp_so_peek_off.c | 183 ++++++++++++++++++
 2 files changed, 184 insertions(+)
 create mode 100644 tools/testing/selftests/net/tcp_so_peek_off.c
tools/testing/selftests/net/Makefile +1 -0
index 8eaffd7a641c..1179e3261bef 100644
@@ -80,6 +80,7 @@ TEST_PROGS += io_uring_zerocopy_tx.sh
 TEST_GEN_FILES += bind_bhash
 TEST_GEN_PROGS += sk_bind_sendto_listen
 TEST_GEN_PROGS += sk_connect_zero_addr
+TEST_GEN_PROGS += tcp_so_peek_off
 TEST_PROGS += test_ingress_egress_chaining.sh
 TEST_GEN_PROGS += so_incoming_cpu
 TEST_PROGS += sctp_vrf.sh
tools/testing/selftests/net/tcp_so_peek_off.c new file +183 -0

183 lines not on this page · raw message

Signature · 1 line
2.45.2