aboutsummaryrefslogtreecommitdiff
path: root/landloc.h
diff options
context:
space:
mode:
authorshtrophic <christoph@liebender.dev>2024-12-30 11:31:11 +0100
committershtrophic <christoph@liebender.dev>2024-12-30 11:31:11 +0100
commita0ca57cc670c9c6dad633ba55a73d810ed61e5ce (patch)
tree72ba9b5cb48a58aa296f1cb72c59695d934f5e01 /landloc.h
parentbbce5e32caeb6ff86eabf08200db701151829884 (diff)
update landloc.h
Diffstat (limited to 'landloc.h')
-rw-r--r--landloc.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/landloc.h b/landloc.h
index 8995871..1e717c9 100644
--- a/landloc.h
+++ b/landloc.h
@@ -70,7 +70,9 @@ int main(void) {
#include <linux/version.h>
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 13, 0)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 13, 0)
+# error "no landlock on kernels older than 5.13.0"
+#endif
#include <unistd.h>
#include <linux/landlock.h>
@@ -224,10 +226,13 @@ int main(void) {
#else
-#define LL_PORT(p, rules) do { (void)p; (void)rules; } while (0)
+#define LL_PORT(p, rules) do {\
+ unsigned short __port = (p);\
+ __u64 __rules = (rules);\
+ (void)__port;\
+ (void)__rules;\
+} while (0)
#endif /* LL_HAVE_NET */
-#endif /* KERNEL_VERSION(5, 13, 0) */
-
#endif /* __LANDLOC_H__ */