all: add support for route type "throw"

After adding support for "blackhole", "unreachable" and "prohibit" route
types, let's also add support for "throw" type. It works basically the
same as the other types, so supporting it seems very straight forward.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1124
This commit is contained in:
Thomas Haller
2022-02-25 21:01:04 +01:00
parent b2e559fab2
commit b8f689ac53
8 changed files with 27 additions and 9 deletions

View File

@@ -1390,7 +1390,8 @@ _ip_route_attribute_validate(const char *name,
RTN_LOCAL,
RTN_BLACKHOLE,
RTN_UNREACHABLE,
RTN_PROHIBIT)) {
RTN_PROHIBIT,
RTN_THROW)) {
g_set_error(error,
NM_CONNECTION_ERROR,
NM_CONNECTION_ERROR_INVALID_PROPERTY,
@@ -1494,6 +1495,7 @@ _nm_ip_route_attribute_validate_all(const NMIPRoute *route, GError **error)
case RTN_BLACKHOLE:
case RTN_UNREACHABLE:
case RTN_PROHIBIT:
case RTN_THROW:
if (route->next_hop) {
g_set_error(error,
NM_CONNECTION_ERROR,

View File

@@ -1006,7 +1006,8 @@ nm_setting_ip4_config_class_init(NMSettingIP4ConfigClass *klass)
* </listitem>
* <listitem>
* <para><literal>"type"</literal> - one of <literal>unicast</literal>, <literal>local</literal>, <literal>blackhole</literal>,
* <literal>unavailable</literal>, <literal>prohibit</literal>. The default is <literal>unicast</literal>.</para>
* <literal>unavailable</literal>, <literal>prohibit</literal>, <literal>throw</literal>.
* The default is <literal>unicast</literal>.</para>
* </listitem>
* <listitem>
* <para><literal>"window"</literal> - an unsigned 32 bit integer.</para>

View File

@@ -1042,7 +1042,8 @@ nm_setting_ip6_config_class_init(NMSettingIP6ConfigClass *klass)
* </listitem>
* <listitem>
* <para><literal>"type"</literal> - one of <literal>unicast</literal>, <literal>local</literal>, <literal>blackhole</literal>,
* <literal>unavailable</literal>, <literal>prohibit</literal>. The default is <literal>unicast</literal>.</para>
* <literal>unavailable</literal>, <literal>prohibit</literal>, <literal>throw</literal>.
* The default is <literal>unicast</literal>.</para>
* </listitem>
* <listitem>
* <para><literal>"window"</literal> - an unsigned 32 bit integer.</para>