Browse Source

rtnl_rule: decode fib_rule_uid_range without use of <linux/fib_rules.h>

* rtnl_rule.c (decode_fib_rule_uid_range): Define struct type for
fib_rule_uid_range explicitly.
(decode_fib_rule_uid_range) [!HAVE_STRUCT_FIB_RULE_UID_RANGE]: Remove.
* xlat/fib_rule_flags.in: Add fallback definitions.

References: https://bugzilla.redhat.com/show_bug.cgi?id=1758201
Eugene Syromyatnikov 1 month ago
parent
commit
bade0cb3cb
2 changed files with 10 additions and 11 deletions
  1. 4
    5
      rtnl_rule.c
  2. 6
    6
      xlat/fib_rule_flags.in

+ 4
- 5
rtnl_rule.c View File

@@ -42,8 +42,10 @@ decode_fib_rule_uid_range(struct tcb *const tcp,
42 42
 			  const unsigned int len,
43 43
 			  const void *const opaque_data)
44 44
 {
45
-#ifdef HAVE_STRUCT_FIB_RULE_UID_RANGE
46
-	struct fib_rule_uid_range range;
45
+	struct /* fib_rule_uid_range */ {
46
+		uint32_t start;
47
+		uint32_t end;
48
+	} range;
47 49
 
48 50
 	if (len < sizeof(range))
49 51
 		return false;
@@ -54,9 +56,6 @@ decode_fib_rule_uid_range(struct tcb *const tcp,
54 56
 	}
55 57
 
56 58
 	return true;
57
-#else
58
-	return false;
59
-#endif
60 59
 }
61 60
 
62 61
 static bool

+ 6
- 6
xlat/fib_rule_flags.in View File

@@ -1,6 +1,6 @@
1
-FIB_RULE_PERMANENT
2
-FIB_RULE_INVERT
3
-FIB_RULE_UNRESOLVED
4
-FIB_RULE_IIF_DETACHED
5
-FIB_RULE_OIF_DETACHED
6
-FIB_RULE_FIND_SADDR
1
+FIB_RULE_PERMANENT	0x00000001
2
+FIB_RULE_INVERT		0x00000002
3
+FIB_RULE_UNRESOLVED	0x00000004
4
+FIB_RULE_IIF_DETACHED	0x00000008
5
+FIB_RULE_OIF_DETACHED	0x00000010
6
+FIB_RULE_FIND_SADDR	0x00010000

Loading…
Cancel
Save