Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

policy: T6676: Invalid route-map caused bgpd to crash #4047

Merged
merged 1 commit into from
Sep 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/conf_mode/policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,10 @@
continue

for rule, rule_config in route_map_config['rule'].items():
# Action 'deny' cannot be used with "continue"
# FRR does not validate it T4827
if rule_config['action'] == 'deny' and 'continue' in rule_config:
raise ConfigError(f'rule {rule} "continue" cannot be used with action deny!')
# Action 'deny' cannot be used with "continue" or "on-match"
# FRR does not validate it T4827, T6676
if rule_config['action'] == 'deny' and ('continue' in rule_config or 'on_match' in rule_config):
raise ConfigError(f'rule {rule} "continue" or "on-match" cannot be used with action deny!')

# Specified community-list must exist
tmp = dict_search('match.community.community_list',
Expand Down Expand Up @@ -230,17 +230,17 @@
if not community_action_compatibility(
rule_action['community']):
raise ConfigError(
f'Unexpected combination between action replace, add, delete or none in community')

Check failure on line 233 in src/conf_mode/policy.py

View workflow job for this annotation

GitHub Actions / ruff-lint / ruff-lint

Ruff (F541)

src/conf_mode/policy.py:233:33: F541 f-string without any placeholders
if 'large_community' in rule_action:
if not community_action_compatibility(
rule_action['large_community']):
raise ConfigError(
f'Unexpected combination between action replace, add, delete or none in large-community')

Check failure on line 238 in src/conf_mode/policy.py

View workflow job for this annotation

GitHub Actions / ruff-lint / ruff-lint

Ruff (F541)

src/conf_mode/policy.py:238:33: F541 f-string without any placeholders
if 'extcommunity' in rule_action:
if not extcommunity_action_compatibility(
rule_action['extcommunity']):
raise ConfigError(
f'Unexpected combination between none, rt, soo, bandwidth, bandwidth-non-transitive in extended-community')

Check failure on line 243 in src/conf_mode/policy.py

View workflow job for this annotation

GitHub Actions / ruff-lint / ruff-lint

Ruff (F541)

src/conf_mode/policy.py:243:33: F541 f-string without any placeholders
# When routing protocols are active some use prefix-lists, route-maps etc.
# to apply the systems routing policy to the learned or redistributed routes.
# When the "routing policy" changes and policies, route-maps etc. are deleted,
Expand Down
Loading