From: Ondrej Zajicek Date: Thu, 21 Mar 2024 23:40:06 +0000 (+0100) Subject: Static: Fix invalid combination of nexthop options X-Git-Tag: v2.15.1~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a698f8d917af8e9b421a667766a42f45e9359616;p=thirdparty%2Fbird.git 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. --- diff --git a/proto/static/config.Y b/proto/static/config.Y index 7b282898a..f1825edff 100644 --- a/proto/static/config.Y +++ b/proto/static/config.Y @@ -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"); } ;