For ages iproute2 has used `struct rtmsg` as the ancillary header for FIB rules and in the process set the protocol value to RTPROT_BOOT. Until ca56209a66 ("net: Allow a rule to track originating protocol") the kernel rules code ignored the protocol value sent from userspace and always returned 0 in notifications. To avoid incompatibility with existing iproute2, send the protocol as a new attribute.
Showing the changes to include/uapi/linux (1 of 4 files). Show all
Unified · Split
| @@ -23,8 +23,8 @@ struct fib_rule_hdr { · 22 unmodified lines | ||
| 23 | 23 | __u8 tos; |
| 24 | 24 | |
| 25 | 25 | __u8 table; |
| 26 | − __u8 proto; | |
| 27 | − __u8 res1; /* reserved */ | |
| 26 | + __u8 res1; /* reserved */ | |
| 27 | + __u8 res2; /* reserved */ | |
| 28 | 28 | __u8 action; |
| 29 | 29 | |
| 30 | 30 | __u32 flags; |
| @@ -58,6 +58,7 @@ enum { · 27 unmodified lines | ||
| 58 | 58 | FRA_PAD, |
| 59 | 59 | FRA_L3MDEV, /* iif or oif is l3mdev goto its table */ |
| 60 | 60 | FRA_UID_RANGE, /* UID range */ |
| 61 | + FRA_PROTOCOL, /* Originator of the rule */ | |
| 61 | 62 | __FRA_MAX |
| 62 | 63 | }; |
| 63 | 64 | |