From 3b994db74b75551d5ab6cc3df5d3b51d3347032b Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Fri, 8 Apr 2022 17:25:13 -0700 Subject: Use stub inline functions for no-op versions of tcp_fastopen*(). Inline functions "use" variables passed as arguments unlike empty macros appeasing compiler warnings about unused variables. --- sys/netinet/tcp_fastopen.h | 51 ++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 43 insertions(+), 8 deletions(-) diff --git a/sys/netinet/tcp_fastopen.h b/sys/netinet/tcp_fastopen.h index 5db10b00df48..f00bc87644f9 100644 --- a/sys/netinet/tcp_fastopen.h +++ b/sys/netinet/tcp_fastopen.h @@ -93,14 +93,49 @@ void tcp_fastopen_disable_path(struct tcpcb *); void tcp_fastopen_update_cache(struct tcpcb *, uint16_t, uint8_t, uint8_t *); #else -#define tcp_fastopen_init() ((void)0) -#define tcp_fastopen_destroy() ((void)0) -#define tcp_fastopen_alloc_counter() NULL -#define tcp_fastopen_decrement_counter(c) ((void)0) -#define tcp_fastopen_check_cookie(i, c, l, lc) (-1) -#define tcp_fastopen_connect(t) ((void)0) -#define tcp_fastopen_disable_path(t) ((void)0) -#define tcp_fastopen_update_cache(t, m, l, c) ((void)0) +static __inline void +tcp_fastopen_init(void) +{ +} + +static __inline void +tcp_fastopen_destroy(void) +{ +} + +static __inline unsigned int * +tcp_fastopen_alloc_counter(void) +{ + return (NULL); +} + +static __inline void +tcp_fastopen_decrement_counter(unsigned int *_counter) +{ +} + +static __inline int +tcp_fastopen_check_cookie(struct in_conninfo *_inc, uint8_t *_cookie, + unsigned int _len, uint64_t *_latest_cookie) +{ + return (-1); +} + +static __inline void +tcp_fastopen_connect(struct tcpcb *_tp) +{ +} + +static __inline void +tcp_fastopen_disable_path(struct tcpcb *_tp) +{ +} + +static __inline void +tcp_fastopen_update_cache(struct tcpcb *_tp, uint16_t _mss, uint8_t _cookie_len, + uint8_t *_cookie) +{ +} #endif /* TCP_RFC7413 */ #endif /* _KERNEL */ -- cgit v1.2.3