Skip to content

Commit

Permalink
validation: remove superfluous comparison
Browse files Browse the repository at this point in the history
Since the check of whether r->table == nd->vrf_table has already failed
in the initial 'if' conditional, r->table is necessarily !=
nd->vrf_table.  It is not necessary to explicitly check for this state
in the 'else if' conditional.  Let's not.
  • Loading branch information
drafnel authored and slyon committed Nov 14, 2024
1 parent d375478 commit 3aba58e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/validation.c
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ adopt_and_validate_vrf_routes(__unused const NetplanParser *npp, GHashTable *net
if (r->table == nd->vrf_table) {
g_debug("%s: Ignoring redundant routing-policy table %d (matches VRF table)", nd->id, r->table);
continue;
} else if (r->table != NETPLAN_ROUTE_TABLE_UNSPEC && r->table != nd->vrf_table) {
} else if (r->table != NETPLAN_ROUTE_TABLE_UNSPEC) {
g_set_error(error, NETPLAN_VALIDATION_ERROR, NETPLAN_ERROR_CONFIG_GENERIC,
"%s: VRF routing-policy table mismatch (%d != %d)", nd->id, nd->vrf_table, r->table);
return FALSE;
Expand Down

0 comments on commit 3aba58e

Please sign in to comment.