mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-13 14:42:06 +00:00
bgpd, zebra: don't compare unsigned < 0
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
This commit is contained in:
parent
cd05906c41
commit
1e03d6bc76
@ -425,17 +425,21 @@ int main(int argc, char **argv)
|
||||
else
|
||||
bgp_port = tmp_port;
|
||||
break;
|
||||
case 'e':
|
||||
multipath_num = atoi(optarg);
|
||||
if (multipath_num > MULTIPATH_NUM
|
||||
|| multipath_num <= 0) {
|
||||
case 'e': {
|
||||
unsigned long int parsed_multipath =
|
||||
strtoul(optarg, NULL, 10);
|
||||
if (parsed_multipath == 0
|
||||
|| parsed_multipath > MULTIPATH_NUM
|
||||
|| parsed_multipath > UINT_MAX) {
|
||||
flog_err(
|
||||
EC_BGP_MULTIPATH,
|
||||
"Multipath Number specified must be less than %d and greater than 0",
|
||||
"Multipath Number specified must be less than %u and greater than 0",
|
||||
MULTIPATH_NUM);
|
||||
return 1;
|
||||
}
|
||||
multipath_num = parsed_multipath;
|
||||
break;
|
||||
}
|
||||
case 'l':
|
||||
bgp_address = optarg;
|
||||
/* listenon implies -n */
|
||||
|
14
zebra/main.c
14
zebra/main.c
@ -331,17 +331,21 @@ int main(int argc, char **argv)
|
||||
case 'a':
|
||||
allow_delete = 1;
|
||||
break;
|
||||
case 'e':
|
||||
zrouter.multipath_num = atoi(optarg);
|
||||
if (zrouter.multipath_num > MULTIPATH_NUM
|
||||
|| zrouter.multipath_num <= 0) {
|
||||
case 'e': {
|
||||
unsigned long int parsed_multipath =
|
||||
strtoul(optarg, NULL, 10);
|
||||
if (parsed_multipath == 0
|
||||
|| parsed_multipath > MULTIPATH_NUM
|
||||
|| parsed_multipath > UINT32_MAX) {
|
||||
flog_err(
|
||||
EC_ZEBRA_BAD_MULTIPATH_NUM,
|
||||
"Multipath Number specified must be less than %d and greater than 0",
|
||||
"Multipath Number specified must be less than %u and greater than 0",
|
||||
MULTIPATH_NUM);
|
||||
return 1;
|
||||
}
|
||||
zrouter.multipath_num = parsed_multipath;
|
||||
break;
|
||||
}
|
||||
case 'o':
|
||||
vrf_default_name_configured = optarg;
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user