aboutgitcodebugslistschat
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2024-11-06 17:54:14 +1100
committerStefano Brivio <sbrivio@redhat.com>2024-11-07 12:47:16 +0100
commit0d7b8201ed5788416d1b36fc3a554b61ad10c201 (patch)
tree34788daf0bd493ee74372e182f185489188215ab
parentc5f4e4d146f6f57a66bd4d7792e8ccf9625d039c (diff)
downloadpasst-0d7b8201ed5788416d1b36fc3a554b61ad10c201.tar
passt-0d7b8201ed5788416d1b36fc3a554b61ad10c201.tar.gz
passt-0d7b8201ed5788416d1b36fc3a554b61ad10c201.tar.bz2
passt-0d7b8201ed5788416d1b36fc3a554b61ad10c201.tar.lz
passt-0d7b8201ed5788416d1b36fc3a554b61ad10c201.tar.xz
passt-0d7b8201ed5788416d1b36fc3a554b61ad10c201.tar.zst
passt-0d7b8201ed5788416d1b36fc3a554b61ad10c201.zip
linux_dep: Generalise tcp_info.h to handling Linux extension compatibility
tcp_info.h exists just to contain a modern enough version of struct tcp_info for our needs, removing compile time dependency on the version of kernel headers. There are several other cases where we can remove similar compile time dependencies on kernel version. Prepare for that by renaming tcp_info.h to linux_dep.h. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
-rw-r--r--linux_dep.h (renamed from tcp_info.h)10
-rw-r--r--tcp.c2
2 files changed, 7 insertions, 5 deletions
diff --git a/tcp_info.h b/linux_dep.h
index 06ccb16..8921623 100644
--- a/tcp_info.h
+++ b/linux_dep.h
@@ -1,14 +1,16 @@
/* SPDX-License-Identifier: GPL-2.0-or-later
* Copyright Red Hat
*
- * Largely derived from include/linux/tcp.h in the Linux kernel
+ * Declarations for Linux specific dependencies
*/
-#ifndef TCP_INFO_H
-#define TCP_INFO_H
+#ifndef LINUX_DEP_H
+#define LINUX_DEP_H
/* struct tcp_info_linux - Information from Linux TCP_INFO getsockopt()
*
+ * Largely derived from include/linux/tcp.h in the Linux kernel
+ *
* Some fields returned by TCP_INFO have been there for ages and are shared with
* BSD. struct tcp_info from netinet/tcp.h has only those fields. There are
* also a many Linux specific extensions to the structure, which are only found
@@ -117,4 +119,4 @@ struct tcp_info_linux {
*/
};
-#endif /* TCP_INFO_H */
+#endif /* LINUX_DEP_H */
diff --git a/tcp.c b/tcp.c
index 56ceba6..1bb122b 100644
--- a/tcp.c
+++ b/tcp.c
@@ -299,10 +299,10 @@
#include "log.h"
#include "inany.h"
#include "flow.h"
+#include "linux_dep.h"
#include "flow_table.h"
#include "tcp_internal.h"
-#include "tcp_info.h"
#include "tcp_buf.h"
/* MSS rounding: see SET_MSS() */