summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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) {
70 70
71#include <linux/version.h> 71#include <linux/version.h>
72 72
73#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 13, 0) 73#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 13, 0)
74# error "no landlock on kernels older than 5.13.0"
75#endif
74 76
75#include <unistd.h> 77#include <unistd.h>
76#include <linux/landlock.h> 78#include <linux/landlock.h>
@@ -224,10 +226,13 @@ int main(void) {
224 226
225#else 227#else
226 228
227#define LL_PORT(p, rules) do { (void)p; (void)rules; } while (0) 229#define LL_PORT(p, rules) do {\
230 unsigned short __port = (p);\
231 __u64 __rules = (rules);\
232 (void)__port;\
233 (void)__rules;\
234} while (0)
228 235
229#endif /* LL_HAVE_NET */ 236#endif /* LL_HAVE_NET */
230 237
231#endif /* KERNEL_VERSION(5, 13, 0) */
232
233#endif /* __LANDLOC_H__ */ 238#endif /* __LANDLOC_H__ */