git: 349d1366edd2 - main - socket: Export the FIB number of sockets

From: Mark Johnston <markj_at_FreeBSD.org>
Date: Mon, 04 Nov 2024 14:56:33 UTC
The branch main has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=349d1366edd23af0059e1798f436089e861d934f

commit 349d1366edd23af0059e1798f436089e861d934f
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2024-11-04 14:39:48 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2024-11-04 14:56:19 +0000

    socket: Export the FIB number of sockets
    
    Reviewed by:    zlei
    MFC after:      1 week
    Sponsored by:   Klara, Inc.
    Sponsored by:   Stormshield
    Differential Revision:  https://reviews.freebsd.org/D47315
---
 sys/kern/uipc_socket.c | 1 +
 sys/sys/socketvar.h    | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c
index a139a9d1f301..d8878505d511 100644
--- a/sys/kern/uipc_socket.c
+++ b/sys/kern/uipc_socket.c
@@ -5033,6 +5033,7 @@ sotoxsocket(struct socket *so, struct xsocket *xso)
 	xso->so_uid = so->so_cred->cr_uid;
 	xso->so_pgid = so->so_sigio ? so->so_sigio->sio_pgid : 0;
 	SOCK_LOCK(so);
+	xso->so_fibnum = so->so_fibnum;
 	if (SOLISTENING(so)) {
 		xso->so_qlen = so->sol_qlen;
 		xso->so_incqlen = so->sol_incqlen;
diff --git a/sys/sys/socketvar.h b/sys/sys/socketvar.h
index 40464f555816..fda8d23f5649 100644
--- a/sys/sys/socketvar.h
+++ b/sys/sys/socketvar.h
@@ -615,7 +615,8 @@ struct xsocket {
 	uint32_t	so_qlimit;
 	pid_t		so_pgid;
 	uid_t		so_uid;
-	int32_t		so_spare32[8];
+	int32_t		so_fibnum;
+	int32_t		so_spare32[7];
 	int16_t		so_type;
 	int16_t		so_options;
 	int16_t		so_linger;