git: 8717c306bd59 - main - tcp: allow userspace use of tcp header flags accessor functions

From: Richard Scheffenegger <rscheff_at_FreeBSD.org>
Date: Fri, 22 Dec 2023 10:22:42 UTC
The branch main has been updated by rscheff:

URL: https://cgit.FreeBSD.org/src/commit/?id=8717c306bd5929b9d3cc9535aa1f9830993033de

commit 8717c306bd5929b9d3cc9535aa1f9830993033de
Author:     Richard Scheffenegger <rscheff@FreeBSD.org>
AuthorDate: 2023-12-21 23:47:36 +0000
Commit:     Richard Scheffenegger <rscheff@FreeBSD.org>
CommitDate: 2023-12-22 01:20:29 +0000

    tcp: allow userspace use of tcp header flags accessor functions
    
    Provide accessor functions to all 12 possible TCP header
    flags for userspace too.
    
    Reviewed By:           zlei
    MFC after:             2 weeks
    Sponsored by:          Netapp, Inc.
    Differential Revision: https://reviews.freebsd.org/D43152
---
 sys/netinet/tcp_var.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h
index f8d5654afa24..af441b4fc7d7 100644
--- a/sys/netinet/tcp_var.h
+++ b/sys/netinet/tcp_var.h
@@ -1576,6 +1576,7 @@ tcp_fields_to_net(struct tcphdr *th)
 	th->th_win = htons(th->th_win);
 	th->th_urp = htons(th->th_urp);
 }
+#endif /* _KERNEL */
 
 static inline uint16_t
 tcp_get_flags(const struct tcphdr *th)
@@ -1589,6 +1590,4 @@ tcp_set_flags(struct tcphdr *th, uint16_t flags)
         th->th_x2    = (flags >> 8) & 0x0f;
         th->th_flags = flags & 0xff;
 }
-#endif /* _KERNEL */
-
 #endif /* _NETINET_TCP_VAR_H_ */