MINOR: config: improve error checking on TCP stick-table tracking

Commit 5d5b5d added support for multiple types to track-sc* but
forgot to check that the types are compatible with the stick-tables.
This commit is contained in:
Willy Tarreau 2012-12-12 00:25:44 +01:00
parent d486ef5045
commit 5f53de79e4

View File

@ -6263,6 +6263,12 @@ int check_config_validity()
curproxy->id, trule->act_prm.trk_ctr.table.n ? trule->act_prm.trk_ctr.table.n : curproxy->id);
cfgerr++;
}
else if (!stktable_compatible_sample(trule->act_prm.trk_ctr.expr, target->table.type)) {
Alert("Proxy '%s': stick-table '%s' uses a type incompatible with the 'track-sc%d' rule.\n",
curproxy->id, trule->act_prm.trk_ctr.table.n ? trule->act_prm.trk_ctr.table.n : curproxy->id,
trule->action == TCP_ACT_TRK_SC1 ? 1 : 2);
cfgerr++;
}
else {
free(trule->act_prm.trk_ctr.table.n);
trule->act_prm.trk_ctr.table.t = &target->table;
@ -6296,6 +6302,12 @@ int check_config_validity()
curproxy->id, trule->act_prm.trk_ctr.table.n ? trule->act_prm.trk_ctr.table.n : curproxy->id);
cfgerr++;
}
else if (!stktable_compatible_sample(trule->act_prm.trk_ctr.expr, target->table.type)) {
Alert("Proxy '%s': stick-table '%s' uses a type incompatible with the 'track-sc%d' rule.\n",
curproxy->id, trule->act_prm.trk_ctr.table.n ? trule->act_prm.trk_ctr.table.n : curproxy->id,
trule->action == TCP_ACT_TRK_SC1 ? 1 : 2);
cfgerr++;
}
else {
free(trule->act_prm.trk_ctr.table.n);
trule->act_prm.trk_ctr.table.t = &target->table;