Skip to contentSkip to conversation

ip: Use the `struct fib_rule_hdr` for rules

PATCH In review Donald Sharp 1 participant 1 message Feb 17, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/3 ip: Use the `struct fib_rule_hdr` for rules

The iprule.c code was using struct rtmsg as the data type to pass into the kernel for the netlink message. While 'struct rtmsg' and struct fib_rule_hdr are the same size and mostly the same, we should use the correct data structure. This commit translates the data structures to have iprule.c use the correct one.

Additionally copy over the modified fib_rules.h file

---
 include/linux/fib_rules.h |   2 +-
 ip/iprule.c               | 105 ++++++++++++++++++++++++----------------------
 2 files changed, 56 insertions(+), 51 deletions(-)
include/linux/fib_rules.h +1 -1
index bbf02a63..21f1fbf3 100644
@@ -22,8 +22,8 @@ struct fib_rule_hdr {
 	__u8		tos;
 
 	__u8		table;
+	__u8		proto;	/* reserved */
 	__u8		res1;	/* reserved */
-	__u8		res2;	/* reserved */
 	__u8		action;
 
 	__u32		flags;
ip/iprule.c +55 -50

253 lines not on this page · raw message

Signature · 1 line
2.14.3