mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2026-05-04 04:31:49 +02:00
CLEANUP: cfgparse: Add direction in functions name that warn on misplaced rules
This only concerns functions emitting warnings about misplaced tcp-request rules. The direction is now specified in the functions name. For instance "warnif_misplaced_tcp_conn" is replaced by "warnif_misplaced_tcp_req_conn".
This commit is contained in:
parent
7710580428
commit
5dcd3b0d99
@ -128,9 +128,9 @@ int cfg_register_postparser(char *name, int (*func)());
|
||||
void cfg_unregister_sections(void);
|
||||
void cfg_backup_sections(struct list *backup_sections);
|
||||
void cfg_restore_sections(struct list *backup_sections);
|
||||
int warnif_misplaced_tcp_conn(struct proxy *proxy, const char *file, int line, const char *arg1, const char *arg2);
|
||||
int warnif_misplaced_tcp_sess(struct proxy *proxy, const char *file, int line, const char *arg, const char *arg2);
|
||||
int warnif_misplaced_tcp_cont(struct proxy *proxy, const char *file, int line, const char *arg, const char *arg2);
|
||||
int warnif_misplaced_tcp_req_conn(struct proxy *proxy, const char *file, int line, const char *arg1, const char *arg2);
|
||||
int warnif_misplaced_tcp_req_sess(struct proxy *proxy, const char *file, int line, const char *arg, const char *arg2);
|
||||
int warnif_misplaced_tcp_req_cont(struct proxy *proxy, const char *file, int line, const char *arg, const char *arg2);
|
||||
int warnif_misplaced_quic_init(struct proxy *proxy, const char *file, int line, const char *arg, const char *arg2);
|
||||
int warnif_cond_conflicts(const struct acl_cond *cond, unsigned int where, const char *file, int line);
|
||||
int warnif_tcp_http_cond(const struct proxy *px, const struct acl_cond *cond);
|
||||
|
||||
@ -193,30 +193,30 @@ static int warnif_misplaced_monitor(struct proxy *proxy, const char *file, int l
|
||||
}
|
||||
|
||||
/* report a warning if a "tcp request content" rule is dangerously placed */
|
||||
int warnif_misplaced_tcp_cont(struct proxy *proxy, const char *file, int line, const char *arg1, const char *arg2)
|
||||
int warnif_misplaced_tcp_req_cont(struct proxy *proxy, const char *file, int line, const char *arg1, const char *arg2)
|
||||
{
|
||||
return warnif_rule_after_monitor(proxy, file, line, arg1, arg2) ||
|
||||
warnif_misplaced_monitor(proxy, file, line, arg1, arg2);
|
||||
}
|
||||
|
||||
/* report a warning if a "tcp request session" rule is dangerously placed */
|
||||
int warnif_misplaced_tcp_sess(struct proxy *proxy, const char *file, int line, const char *arg1, const char *arg2)
|
||||
int warnif_misplaced_tcp_req_sess(struct proxy *proxy, const char *file, int line, const char *arg1, const char *arg2)
|
||||
{
|
||||
return warnif_rule_after_tcp_cont(proxy, file, line, arg1, arg2) ||
|
||||
warnif_misplaced_tcp_cont(proxy, file, line, arg1, arg2);
|
||||
warnif_misplaced_tcp_req_cont(proxy, file, line, arg1, arg2);
|
||||
}
|
||||
|
||||
/* report a warning if a "tcp request connection" rule is dangerously placed */
|
||||
int warnif_misplaced_tcp_conn(struct proxy *proxy, const char *file, int line, const char *arg1, const char *arg2)
|
||||
int warnif_misplaced_tcp_req_conn(struct proxy *proxy, const char *file, int line, const char *arg1, const char *arg2)
|
||||
{
|
||||
return warnif_rule_after_tcp_sess(proxy, file, line, arg1, arg2) ||
|
||||
warnif_misplaced_tcp_sess(proxy, file, line, arg1, arg2);
|
||||
warnif_misplaced_tcp_req_sess(proxy, file, line, arg1, arg2);
|
||||
}
|
||||
|
||||
int warnif_misplaced_quic_init(struct proxy *proxy, const char *file, int line, const char *arg1, const char *arg2)
|
||||
{
|
||||
return warnif_rule_after_tcp_conn(proxy, file, line, arg1, arg2) ||
|
||||
warnif_misplaced_tcp_conn(proxy, file, line, arg1, arg2);
|
||||
warnif_misplaced_tcp_req_conn(proxy, file, line, arg1, arg2);
|
||||
}
|
||||
|
||||
int cfg_parse_listen(const char *file, int linenum, char **args, int kwm)
|
||||
|
||||
@ -1319,7 +1319,7 @@ static int tcp_parse_tcp_req(char **args, int section_type, struct proxy *curpx,
|
||||
}
|
||||
|
||||
/* the following function directly emits the warning */
|
||||
warnif_misplaced_tcp_cont(curpx, file, line, args[0], args[1]);
|
||||
warnif_misplaced_tcp_req_cont(curpx, file, line, args[0], args[1]);
|
||||
LIST_APPEND(&curpx->tcp_req.inspect_rules, &rule->list);
|
||||
}
|
||||
else if (strcmp(args[1], "connection") == 0) {
|
||||
@ -1364,7 +1364,7 @@ static int tcp_parse_tcp_req(char **args, int section_type, struct proxy *curpx,
|
||||
}
|
||||
|
||||
/* the following function directly emits the warning */
|
||||
warnif_misplaced_tcp_conn(curpx, file, line, args[0], args[1]);
|
||||
warnif_misplaced_tcp_req_conn(curpx, file, line, args[0], args[1]);
|
||||
LIST_APPEND(&curpx->tcp_req.l4_rules, &rule->list);
|
||||
}
|
||||
else if (strcmp(args[1], "session") == 0) {
|
||||
@ -1408,7 +1408,7 @@ static int tcp_parse_tcp_req(char **args, int section_type, struct proxy *curpx,
|
||||
}
|
||||
|
||||
/* the following function directly emits the warning */
|
||||
warnif_misplaced_tcp_sess(curpx, file, line, args[0], args[1]);
|
||||
warnif_misplaced_tcp_req_sess(curpx, file, line, args[0], args[1]);
|
||||
LIST_APPEND(&curpx->tcp_req.l5_rules, &rule->list);
|
||||
}
|
||||
else {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user