mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2024-11-17 08:38:42 +00:00
Static: Fix invalid combination of nexthop options
BFD requires defined local IP, but for nexthop with onlink there might not be such address. So we reject this combination of nexthop options. This prevent crash where such combination of options is used.
This commit is contained in:
parent
d21a508e8d
commit
a698f8d917
@ -95,6 +95,8 @@ stat_nexthop:
|
||||
}
|
||||
| stat_nexthop ONLINK bool {
|
||||
this_snh->onlink = $3;
|
||||
if (this_snh->use_bfd && this_snh->onlink)
|
||||
cf_error("Options 'bfd' and 'onlink' cannot be combined");
|
||||
}
|
||||
| stat_nexthop WEIGHT expr {
|
||||
this_snh->weight = $3 - 1;
|
||||
@ -102,6 +104,8 @@ stat_nexthop:
|
||||
}
|
||||
| stat_nexthop BFD bool {
|
||||
this_snh->use_bfd = $3; cf_check_bfd($3);
|
||||
if (this_snh->use_bfd && this_snh->onlink)
|
||||
cf_error("Options 'bfd' and 'onlink' cannot be combined");
|
||||
}
|
||||
;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user