mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-03 04:40:13 +01:00
platform: detect kernel support for FRA_PROTOCOL
(cherry picked from commit cd62d43963)
This commit is contained in:
parent
bf36fa11d2
commit
6bfce3587e
3 changed files with 13 additions and 0 deletions
|
|
@ -3414,6 +3414,13 @@ _new_from_nl_routing_rule (struct nlmsghdr *nlh, gboolean id_only)
|
|||
else
|
||||
nm_assert (props->protocol == RTPROT_UNSPEC);
|
||||
|
||||
if (!_nm_platform_kernel_support_detected (NM_PLATFORM_KERNEL_SUPPORT_TYPE_FRA_PROTOCOL)) {
|
||||
/* FRA_PROTOCOL was added in kernel 4.17, dated 3 June, 2018.
|
||||
* See commit 1b71af6053af1bd2f849e9fda4f71c1e3f145dcf. */
|
||||
_nm_platform_kernel_support_init (NM_PLATFORM_KERNEL_SUPPORT_TYPE_FRA_PROTOCOL,
|
||||
tb[FRA_PROTOCOL] ? 1 : -1);
|
||||
}
|
||||
|
||||
if (tb[FRA_IP_PROTO])
|
||||
props->ip_proto = nla_get_u8 (tb[FRA_IP_PROTO]);
|
||||
|
||||
|
|
|
|||
|
|
@ -296,6 +296,11 @@ static const struct {
|
|||
.name = "RTA_PREF",
|
||||
.desc = "ability to set router preference for IPv6 routes",
|
||||
},
|
||||
[NM_PLATFORM_KERNEL_SUPPORT_TYPE_FRA_PROTOCOL] = {
|
||||
.compile_time_default = (FRA_MAX >= 21 /* FRA_PROTOCOL */),
|
||||
.name = "FRA_PROTOCOL",
|
||||
.desc = "FRA_PROTOCOL attribute for policy routing rules",
|
||||
},
|
||||
};
|
||||
|
||||
int
|
||||
|
|
|
|||
|
|
@ -848,6 +848,7 @@ typedef enum {
|
|||
NM_PLATFORM_KERNEL_SUPPORT_TYPE_EXTENDED_IFA_FLAGS,
|
||||
NM_PLATFORM_KERNEL_SUPPORT_TYPE_USER_IPV6LL,
|
||||
NM_PLATFORM_KERNEL_SUPPORT_TYPE_RTA_PREF,
|
||||
NM_PLATFORM_KERNEL_SUPPORT_TYPE_FRA_PROTOCOL,
|
||||
_NM_PLATFORM_KERNEL_SUPPORT_NUM,
|
||||
} NMPlatformKernelSupportType;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue