network: add SuppressPrefixLength option to RoutingPolicyRule (#14736)

Closes #14724.
This commit is contained in:
Naïm Favier
2020-02-03 08:25:48 +09:00
committed by GitHub
parent e06d7d0fb0
commit 53e1ba280f
9 changed files with 337 additions and 230 deletions
+16
View File
@@ -698,6 +698,22 @@ int parse_ip_port_range(const char *s, uint16_t *low, uint16_t *high) {
return 0;
}
int parse_ip_prefix_length(const char *s, int *ret) {
unsigned l;
int r;
r = safe_atou(s, &l);
if (r < 0)
return r;
if (l > 128)
return -ERANGE;
*ret = (int) l;
return 0;
}
int parse_dev(const char *s, dev_t *ret) {
const char *major;
unsigned x, y;