mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-03-13 12:58:20 +03:00
network: make IPProtocol= also accept IP protocol number
This commit is contained in:
parent
97f9df9e30
commit
3a269dcf51
@ -1009,7 +1009,9 @@
|
||||
<varlistentry>
|
||||
<term><varname>IPProtocol=</varname></term>
|
||||
<listitem>
|
||||
<para>Specifies the IP protocol to match in forwarding information base (FIB) rules. Accepted values are <literal>tcp</literal>, <literal>udp</literal> and <literal>sctp</literal>.
|
||||
<para>Specifies the IP protocol to match in forwarding information base (FIB) rules. Takes IP protocol name such as <literal>tcp</literal>,
|
||||
<literal>udp</literal> or <literal>sctp</literal>, or IP protocol number such as <literal>6</literal> for <literal>tcp</literal> or
|
||||
<literal>17</literal> for <literal>udp</literal>.
|
||||
Defaults to unset.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -958,14 +958,9 @@ int config_parse_routing_policy_rule_ip_protocol(
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
r = ip_protocol_from_name(rvalue);
|
||||
r = parse_ip_protocol(rvalue);
|
||||
if (r < 0) {
|
||||
log_syntax(unit, LOG_ERR, filename, line, r, "Failed to parse routing policy rule protocol, ignoring: %s", rvalue);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!IN_SET(r, IPPROTO_TCP, IPPROTO_UDP, IPPROTO_SCTP)) {
|
||||
log_syntax(unit, LOG_ERR, filename, line, 0, "Invalid protocol '%s'. Protocol should be tcp/udp/sctp, ignoring", rvalue);
|
||||
log_syntax(unit, LOG_ERR, filename, line, r, "Failed to parse IP protocol '%s' for routing policy rule, ignoring: %m", rvalue);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user