History log of /src/tests/sys/netlink/netlink_socket.c (Results 1 – 15 of 15)
Revision Date Author Comments
# aab45f2a 28-Sep-2025 Gleb Smirnoff <glebius@FreeBSD.org>

tests/netlink: fix flaky netlink_sockets:sizes

The problem is that fullsocket() creates a socket that has both send and
receive buffers full and as we process messages from the receive buffer we
all

tests/netlink: fix flaky netlink_sockets:sizes

The problem is that fullsocket() creates a socket that has both send and
receive buffers full and as we process messages from the receive buffer we
allow the kernel to continue processing of the send buffer and a new
message may arrive while the test expects that no new messages arrive.
Fix that by creating a socket that has several messages in the receive
buffer, but don't have any in the send buffer.

show more ...


# 215a0654 21-Jul-2025 Siva Mahadevan <me@svmhdvn.name>

tests/sys/netlink: use require.kmods property instead of ad-hoc checks

Signed-off-by: Siva Mahadevan <me@svmhdvn.name>
Sponsored by: The FreeBSD Foundation
Reviewed by: imp
Pull Request: https://git

tests/sys/netlink: use require.kmods property instead of ad-hoc checks

Signed-off-by: Siva Mahadevan <me@svmhdvn.name>
Sponsored by: The FreeBSD Foundation
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1780

show more ...


# 26caf57e 11-Jan-2024 Gleb Smirnoff <glebius@FreeBSD.org>

tests/netlink: improve recently added netlink_socket:membership

Change sequence of syscalls: instead of "add, delete, check, check"
run sequence "add, check, delete, check". Seems to make more sens

tests/netlink: improve recently added netlink_socket:membership

Change sequence of syscalls: instead of "add, delete, check, check"
run sequence "add, check, delete, check". Seems to make more sense.

Do minimal parsing of incoming messages: find the IPv4 address there
and compare it to the original.

show more ...


# 8338ea1d 10-Jan-2024 Gleb Smirnoff <glebius@FreeBSD.org>

tests/netlink: add minimal test for a group writer

Subscribe a socket for RTNLGRP_IPV4_ROUTE announcements, add & delete
a route and check that announcements came in.


# 0ad011ec 02-Jan-2024 Gleb Smirnoff <glebius@FreeBSD.org>

tests/netlink: add netlink socket buffer test

With upcoming protocol specific socket buffer for Netlink we need some
additional tests that cover basic socket operations, w/o much of actual
Netlink k

tests/netlink: add netlink socket buffer test

With upcoming protocol specific socket buffer for Netlink we need some
additional tests that cover basic socket operations, w/o much of actual
Netlink knowledge. Following tests are performed:

1) Overflow. If an application keeps sending messages to the kernel,
but doesn't read out the replies, then first the receive buffer shall
fill and after that further messages from applications will be queued
on the send buffer until it is filled. After that socket operations
should block. However, reading from the receive buffer some data should
wake up the taskqueue and the send buffer should start draining again.

2) Peek & trunc. Check that socket correctly reports amount of readable
data with MSG_PEEK & MSG_TRUNC. This is typical pattern of Netlink apps.

3) Sizes. Check that zero size read doesn't affect the socket, undersize
read will return one truncated message and the message is removed from
the buffer. Check that large buffer will be filled in one read, without
any boundaries imposed by internal representation of the buffer. Check
that any meaningful read is amended with control data if requested so.

Reviewed by: melifaro
Differential Revision: https://reviews.freebsd.org/D42525

show more ...


# aab45f2a 28-Sep-2025 Gleb Smirnoff <glebius@FreeBSD.org>

tests/netlink: fix flaky netlink_sockets:sizes

The problem is that fullsocket() creates a socket that has both send and
receive buffers full and as we process messages from the receive buffer we
all

tests/netlink: fix flaky netlink_sockets:sizes

The problem is that fullsocket() creates a socket that has both send and
receive buffers full and as we process messages from the receive buffer we
allow the kernel to continue processing of the send buffer and a new
message may arrive while the test expects that no new messages arrive.
Fix that by creating a socket that has several messages in the receive
buffer, but don't have any in the send buffer.

show more ...


# 215a0654 21-Jul-2025 Siva Mahadevan <me@svmhdvn.name>

tests/sys/netlink: use require.kmods property instead of ad-hoc checks

Signed-off-by: Siva Mahadevan <me@svmhdvn.name>
Sponsored by: The FreeBSD Foundation
Reviewed by: imp
Pull Request: https://git

tests/sys/netlink: use require.kmods property instead of ad-hoc checks

Signed-off-by: Siva Mahadevan <me@svmhdvn.name>
Sponsored by: The FreeBSD Foundation
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1780

show more ...


# 26caf57e 11-Jan-2024 Gleb Smirnoff <glebius@FreeBSD.org>

tests/netlink: improve recently added netlink_socket:membership

Change sequence of syscalls: instead of "add, delete, check, check"
run sequence "add, check, delete, check". Seems to make more sens

tests/netlink: improve recently added netlink_socket:membership

Change sequence of syscalls: instead of "add, delete, check, check"
run sequence "add, check, delete, check". Seems to make more sense.

Do minimal parsing of incoming messages: find the IPv4 address there
and compare it to the original.

show more ...


# 8338ea1d 10-Jan-2024 Gleb Smirnoff <glebius@FreeBSD.org>

tests/netlink: add minimal test for a group writer

Subscribe a socket for RTNLGRP_IPV4_ROUTE announcements, add & delete
a route and check that announcements came in.


# 0ad011ec 02-Jan-2024 Gleb Smirnoff <glebius@FreeBSD.org>

tests/netlink: add netlink socket buffer test

With upcoming protocol specific socket buffer for Netlink we need some
additional tests that cover basic socket operations, w/o much of actual
Netlink k

tests/netlink: add netlink socket buffer test

With upcoming protocol specific socket buffer for Netlink we need some
additional tests that cover basic socket operations, w/o much of actual
Netlink knowledge. Following tests are performed:

1) Overflow. If an application keeps sending messages to the kernel,
but doesn't read out the replies, then first the receive buffer shall
fill and after that further messages from applications will be queued
on the send buffer until it is filled. After that socket operations
should block. However, reading from the receive buffer some data should
wake up the taskqueue and the send buffer should start draining again.

2) Peek & trunc. Check that socket correctly reports amount of readable
data with MSG_PEEK & MSG_TRUNC. This is typical pattern of Netlink apps.

3) Sizes. Check that zero size read doesn't affect the socket, undersize
read will return one truncated message and the message is removed from
the buffer. Check that large buffer will be filled in one read, without
any boundaries imposed by internal representation of the buffer. Check
that any meaningful read is amended with control data if requested so.

Reviewed by: melifaro
Differential Revision: https://reviews.freebsd.org/D42525

show more ...


# aab45f2a 28-Sep-2025 Gleb Smirnoff <glebius@FreeBSD.org>

tests/netlink: fix flaky netlink_sockets:sizes

The problem is that fullsocket() creates a socket that has both send and
receive buffers full and as we process messages from the receive buffer we
all

tests/netlink: fix flaky netlink_sockets:sizes

The problem is that fullsocket() creates a socket that has both send and
receive buffers full and as we process messages from the receive buffer we
allow the kernel to continue processing of the send buffer and a new
message may arrive while the test expects that no new messages arrive.
Fix that by creating a socket that has several messages in the receive
buffer, but don't have any in the send buffer.

show more ...


# 215a0654 21-Jul-2025 Siva Mahadevan <me@svmhdvn.name>

tests/sys/netlink: use require.kmods property instead of ad-hoc checks

Signed-off-by: Siva Mahadevan <me@svmhdvn.name>
Sponsored by: The FreeBSD Foundation
Reviewed by: imp
Pull Request: https://git

tests/sys/netlink: use require.kmods property instead of ad-hoc checks

Signed-off-by: Siva Mahadevan <me@svmhdvn.name>
Sponsored by: The FreeBSD Foundation
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1780

show more ...


# 26caf57e 11-Jan-2024 Gleb Smirnoff <glebius@FreeBSD.org>

tests/netlink: improve recently added netlink_socket:membership

Change sequence of syscalls: instead of "add, delete, check, check"
run sequence "add, check, delete, check". Seems to make more sens

tests/netlink: improve recently added netlink_socket:membership

Change sequence of syscalls: instead of "add, delete, check, check"
run sequence "add, check, delete, check". Seems to make more sense.

Do minimal parsing of incoming messages: find the IPv4 address there
and compare it to the original.

show more ...


# 8338ea1d 10-Jan-2024 Gleb Smirnoff <glebius@FreeBSD.org>

tests/netlink: add minimal test for a group writer

Subscribe a socket for RTNLGRP_IPV4_ROUTE announcements, add & delete
a route and check that announcements came in.


# 0ad011ec 02-Jan-2024 Gleb Smirnoff <glebius@FreeBSD.org>

tests/netlink: add netlink socket buffer test

With upcoming protocol specific socket buffer for Netlink we need some
additional tests that cover basic socket operations, w/o much of actual
Netlink k

tests/netlink: add netlink socket buffer test

With upcoming protocol specific socket buffer for Netlink we need some
additional tests that cover basic socket operations, w/o much of actual
Netlink knowledge. Following tests are performed:

1) Overflow. If an application keeps sending messages to the kernel,
but doesn't read out the replies, then first the receive buffer shall
fill and after that further messages from applications will be queued
on the send buffer until it is filled. After that socket operations
should block. However, reading from the receive buffer some data should
wake up the taskqueue and the send buffer should start draining again.

2) Peek & trunc. Check that socket correctly reports amount of readable
data with MSG_PEEK & MSG_TRUNC. This is typical pattern of Netlink apps.

3) Sizes. Check that zero size read doesn't affect the socket, undersize
read will return one truncated message and the message is removed from
the buffer. Check that large buffer will be filled in one read, without
any boundaries imposed by internal representation of the buffer. Check
that any meaningful read is amended with control data if requested so.

Reviewed by: melifaro
Differential Revision: https://reviews.freebsd.org/D42525

show more ...