summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2024-03-22 00:40:06 +0100
committerOndrej Zajicek <santiago@crfreenet.org>2024-03-22 00:40:06 +0100
commita698f8d917af8e9b421a667766a42f45e9359616 (patch)
tree377490821aee6d352ddcb76c2a62933d0312584c
parentd21a508e8d9210f5b3b60d8fc8b79a344d4a7440 (diff)
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.
-rw-r--r--proto/static/config.Y4
1 files changed, 4 insertions, 0 deletions
diff --git a/proto/static/config.Y b/proto/static/config.Y
index 7b282898..f1825edf 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");
}
;