git: 3b994db74b75 - main - Use stub inline functions for no-op versions of tcp_fastopen*().
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 09 Apr 2022 00:27:49 UTC
The branch main has been updated by jhb:
URL: https://cgit.FreeBSD.org/src/commit/?id=3b994db74b75551d5ab6cc3df5d3b51d3347032b
commit 3b994db74b75551d5ab6cc3df5d3b51d3347032b
Author: John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2022-04-09 00:25:13 +0000
Commit: John Baldwin <jhb@FreeBSD.org>
CommitDate: 2022-04-09 00:25:13 +0000
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 */