network: add SuppressPrefixLength option to RoutingPolicyRule (#14736)
Closes #14724.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user