mirror of
https://github.com/systemd/systemd.git
synced 2025-01-10 05:18:17 +03:00
network: geneve: add InheritInnerProtocol flag
This commit is contained in:
parent
27e695840c
commit
417283c5c3
@ -826,6 +826,13 @@
|
||||
<para>Accepts the same key as in [VXLAN] section.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><varname>InheritInnerProtocol=</varname></term>
|
||||
<listitem>
|
||||
<para>Takes a boolean. When true, inner Layer 3 protcol is set as Protocol Type in the GENEVE
|
||||
header instead of Ethernet. Defaults to false.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
|
@ -192,19 +192,20 @@ static const NLAPolicy rtnl_link_info_data_can_policies[] = {
|
||||
};
|
||||
|
||||
static const NLAPolicy rtnl_link_info_data_geneve_policies[] = {
|
||||
[IFLA_GENEVE_ID] = BUILD_POLICY(U32),
|
||||
[IFLA_GENEVE_REMOTE] = BUILD_POLICY_WITH_SIZE(IN_ADDR, sizeof(struct in_addr)),
|
||||
[IFLA_GENEVE_TTL] = BUILD_POLICY(U8),
|
||||
[IFLA_GENEVE_TOS] = BUILD_POLICY(U8),
|
||||
[IFLA_GENEVE_PORT] = BUILD_POLICY(U16),
|
||||
[IFLA_GENEVE_COLLECT_METADATA] = BUILD_POLICY(FLAG),
|
||||
[IFLA_GENEVE_REMOTE6] = BUILD_POLICY_WITH_SIZE(IN_ADDR, sizeof(struct in6_addr)),
|
||||
[IFLA_GENEVE_UDP_CSUM] = BUILD_POLICY(U8),
|
||||
[IFLA_GENEVE_UDP_ZERO_CSUM6_TX] = BUILD_POLICY(U8),
|
||||
[IFLA_GENEVE_UDP_ZERO_CSUM6_RX] = BUILD_POLICY(U8),
|
||||
[IFLA_GENEVE_LABEL] = BUILD_POLICY(U32),
|
||||
[IFLA_GENEVE_TTL_INHERIT] = BUILD_POLICY(U8),
|
||||
[IFLA_GENEVE_DF] = BUILD_POLICY(U8),
|
||||
[IFLA_GENEVE_ID] = BUILD_POLICY(U32),
|
||||
[IFLA_GENEVE_REMOTE] = BUILD_POLICY_WITH_SIZE(IN_ADDR, sizeof(struct in_addr)),
|
||||
[IFLA_GENEVE_TTL] = BUILD_POLICY(U8),
|
||||
[IFLA_GENEVE_TOS] = BUILD_POLICY(U8),
|
||||
[IFLA_GENEVE_PORT] = BUILD_POLICY(U16),
|
||||
[IFLA_GENEVE_COLLECT_METADATA] = BUILD_POLICY(FLAG),
|
||||
[IFLA_GENEVE_REMOTE6] = BUILD_POLICY_WITH_SIZE(IN_ADDR, sizeof(struct in6_addr)),
|
||||
[IFLA_GENEVE_UDP_CSUM] = BUILD_POLICY(U8),
|
||||
[IFLA_GENEVE_UDP_ZERO_CSUM6_TX] = BUILD_POLICY(U8),
|
||||
[IFLA_GENEVE_UDP_ZERO_CSUM6_RX] = BUILD_POLICY(U8),
|
||||
[IFLA_GENEVE_LABEL] = BUILD_POLICY(U32),
|
||||
[IFLA_GENEVE_TTL_INHERIT] = BUILD_POLICY(U8),
|
||||
[IFLA_GENEVE_DF] = BUILD_POLICY(U8),
|
||||
[IFLA_GENEVE_INNER_PROTO_INHERIT] = BUILD_POLICY(FLAG),
|
||||
};
|
||||
|
||||
static const NLAPolicy rtnl_link_info_data_gre_policies[] = {
|
||||
|
@ -89,6 +89,12 @@ static int netdev_geneve_fill_message_create(NetDev *netdev, Link *link, sd_netl
|
||||
return r;
|
||||
}
|
||||
|
||||
if (v->inherit_inner_protocol) {
|
||||
r = sd_netlink_message_append_flag(m, IFLA_GENEVE_INNER_PROTO_INHERIT);
|
||||
if (r < 0)
|
||||
return r;
|
||||
}
|
||||
|
||||
if (v->geneve_df != _NETDEV_GENEVE_DF_INVALID) {
|
||||
r = sd_netlink_message_append_u8(m, IFLA_GENEVE_DF, v->geneve_df);
|
||||
if (r < 0)
|
||||
|
@ -37,6 +37,8 @@ struct Geneve {
|
||||
|
||||
GeneveDF geneve_df;
|
||||
union in_addr_union remote;
|
||||
|
||||
bool inherit_inner_protocol;
|
||||
};
|
||||
|
||||
DEFINE_NETDEV_CAST(GENEVE, Geneve);
|
||||
|
@ -162,6 +162,7 @@ GENEVE.UDP6ZeroChecksumTx, config_parse_bool,
|
||||
GENEVE.DestinationPort, config_parse_ip_port, 0, offsetof(Geneve, dest_port)
|
||||
GENEVE.IPDoNotFragment, config_parse_geneve_df, 0, offsetof(Geneve, geneve_df)
|
||||
GENEVE.FlowLabel, config_parse_geneve_flow_label, 0, 0
|
||||
GENEVE.InheritInnerProtocol, config_parse_bool, 0, offsetof(Geneve, inherit_inner_protocol)
|
||||
MACsec.Port, config_parse_macsec_port, 0, 0
|
||||
MACsec.Encrypt, config_parse_tristate, 0, offsetof(MACsec, encrypt)
|
||||
MACsecReceiveChannel.Port, config_parse_macsec_port, 0, 0
|
||||
|
Loading…
Reference in New Issue
Block a user