network: make IPProtocol= also accept IP protocol number

This commit is contained in:
Yu Watanabe
2018-12-02 06:13:47 +01:00
parent 97f9df9e30
commit 3a269dcf51
2 changed files with 5 additions and 8 deletions
+2 -7
View File
@@ -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;
}