diff --git a/man/systemd.network.xml b/man/systemd.network.xml index 1484c073ef..229449c5ac 100644 --- a/man/systemd.network.xml +++ b/man/systemd.network.xml @@ -1009,7 +1009,9 @@ IPProtocol= - Specifies the IP protocol to match in forwarding information base (FIB) rules. Accepted values are tcp, udp and sctp. + Specifies the IP protocol to match in forwarding information base (FIB) rules. Takes IP protocol name such as tcp, + udp or sctp, or IP protocol number such as 6 for tcp or + 17 for udp. Defaults to unset. diff --git a/src/network/networkd-routing-policy-rule.c b/src/network/networkd-routing-policy-rule.c index 5d87b27677..649876529e 100644 --- a/src/network/networkd-routing-policy-rule.c +++ b/src/network/networkd-routing-policy-rule.c @@ -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; }