tcp: fix ports

inline is only support in C99 and newer. To support also C89, use
__inline instead as suggested by dim.

Reported by:		eduardo
Reviewed by:		rscheff, markj, dim, imp
Tested by:		eduardo
Fixes:			a8b70cf260 ("netpfil: Use accessor functions and named constants for all tcphdr flags")
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D43231
This commit is contained in:
Michael Tuexen 2023-12-30 03:28:13 +01:00
parent 1b8d70b2eb
commit 642ac6015b

View file

@ -79,13 +79,13 @@ struct tcphdr {
u_short th_urp; /* urgent pointer */
};
static inline uint16_t
static __inline uint16_t
tcp_get_flags(const struct tcphdr *th)
{
return (((uint16_t)th->th_x2 << 8) | th->th_flags);
}
static inline void
static __inline void
tcp_set_flags(struct tcphdr *th, uint16_t flags)
{
th->th_x2 = (flags >> 8) & 0x0f;