The kernel parses FRA_SUPPRESS_PREFIXLEN as uint32_t, but internally
handled as signed integer and negative values as unset. Let's explicitly
specify the size of the variable.
No functional change, just refactoring.
return 0;
}
-int parse_ip_prefix_length(const char *s, int *ret) {
+int parse_ip_prefix_length(const char *s, int32_t *ret) {
unsigned l;
int r;
if (l > 128)
return -ERANGE;
- *ret = (int) l;
+ *ret = (int32_t) l;
return 0;
}
int parse_ip_port(const char *s, uint16_t *ret);
int parse_ip_port_range(const char *s, uint16_t *low, uint16_t *high, bool allow_zero);
-int parse_ip_prefix_length(const char *s, int *ret);
+int parse_ip_prefix_length(const char *s, int32_t *ret);
int parse_oom_score_adjust(const char *s, int *ret);
/* FRA_FLOW */
/* FRA_TUN_ID */
int32_t suppress_ifgroup; /* FRA_SUPPRESS_IFGROUP */
- int suppress_prefixlen; /* FRA_SUPPRESS_PREFIXLEN */
+ int32_t suppress_prefixlen; /* FRA_SUPPRESS_PREFIXLEN */
uint32_t table; /* FRA_TABLE, also used in struct fib_rule_hdr */
uint32_t fwmask; /* FRA_FWMASK */
char *oif; /* FRA_OIFNAME */