Skip to content

Commit 5dcd3b0

Browse files
committed
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".
1 parent 7710580 commit 5dcd3b0

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

include/haproxy/cfgparse.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,9 @@ int cfg_register_postparser(char *name, int (*func)());
128128
void cfg_unregister_sections(void);
129129
void cfg_backup_sections(struct list *backup_sections);
130130
void cfg_restore_sections(struct list *backup_sections);
131-
int warnif_misplaced_tcp_conn(struct proxy *proxy, const char *file, int line, const char *arg1, const char *arg2);
132-
int warnif_misplaced_tcp_sess(struct proxy *proxy, const char *file, int line, const char *arg, const char *arg2);
133-
int warnif_misplaced_tcp_cont(struct proxy *proxy, const char *file, int line, const char *arg, const char *arg2);
131+
int warnif_misplaced_tcp_req_conn(struct proxy *proxy, const char *file, int line, const char *arg1, const char *arg2);
132+
int warnif_misplaced_tcp_req_sess(struct proxy *proxy, const char *file, int line, const char *arg, const char *arg2);
133+
int warnif_misplaced_tcp_req_cont(struct proxy *proxy, const char *file, int line, const char *arg, const char *arg2);
134134
int warnif_misplaced_quic_init(struct proxy *proxy, const char *file, int line, const char *arg, const char *arg2);
135135
int warnif_cond_conflicts(const struct acl_cond *cond, unsigned int where, const char *file, int line);
136136
int warnif_tcp_http_cond(const struct proxy *px, const struct acl_cond *cond);

src/cfgparse-listen.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -193,30 +193,30 @@ static int warnif_misplaced_monitor(struct proxy *proxy, const char *file, int l
193193
}
194194

195195
/* report a warning if a "tcp request content" rule is dangerously placed */
196-
int warnif_misplaced_tcp_cont(struct proxy *proxy, const char *file, int line, const char *arg1, const char *arg2)
196+
int warnif_misplaced_tcp_req_cont(struct proxy *proxy, const char *file, int line, const char *arg1, const char *arg2)
197197
{
198198
return warnif_rule_after_monitor(proxy, file, line, arg1, arg2) ||
199199
warnif_misplaced_monitor(proxy, file, line, arg1, arg2);
200200
}
201201

202202
/* report a warning if a "tcp request session" rule is dangerously placed */
203-
int warnif_misplaced_tcp_sess(struct proxy *proxy, const char *file, int line, const char *arg1, const char *arg2)
203+
int warnif_misplaced_tcp_req_sess(struct proxy *proxy, const char *file, int line, const char *arg1, const char *arg2)
204204
{
205205
return warnif_rule_after_tcp_cont(proxy, file, line, arg1, arg2) ||
206-
warnif_misplaced_tcp_cont(proxy, file, line, arg1, arg2);
206+
warnif_misplaced_tcp_req_cont(proxy, file, line, arg1, arg2);
207207
}
208208

209209
/* report a warning if a "tcp request connection" rule is dangerously placed */
210-
int warnif_misplaced_tcp_conn(struct proxy *proxy, const char *file, int line, const char *arg1, const char *arg2)
210+
int warnif_misplaced_tcp_req_conn(struct proxy *proxy, const char *file, int line, const char *arg1, const char *arg2)
211211
{
212212
return warnif_rule_after_tcp_sess(proxy, file, line, arg1, arg2) ||
213-
warnif_misplaced_tcp_sess(proxy, file, line, arg1, arg2);
213+
warnif_misplaced_tcp_req_sess(proxy, file, line, arg1, arg2);
214214
}
215215

216216
int warnif_misplaced_quic_init(struct proxy *proxy, const char *file, int line, const char *arg1, const char *arg2)
217217
{
218218
return warnif_rule_after_tcp_conn(proxy, file, line, arg1, arg2) ||
219-
warnif_misplaced_tcp_conn(proxy, file, line, arg1, arg2);
219+
warnif_misplaced_tcp_req_conn(proxy, file, line, arg1, arg2);
220220
}
221221

222222
int cfg_parse_listen(const char *file, int linenum, char **args, int kwm)

src/tcp_rules.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1319,7 +1319,7 @@ static int tcp_parse_tcp_req(char **args, int section_type, struct proxy *curpx,
13191319
}
13201320

13211321
/* the following function directly emits the warning */
1322-
warnif_misplaced_tcp_cont(curpx, file, line, args[0], args[1]);
1322+
warnif_misplaced_tcp_req_cont(curpx, file, line, args[0], args[1]);
13231323
LIST_APPEND(&curpx->tcp_req.inspect_rules, &rule->list);
13241324
}
13251325
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,
13641364
}
13651365

13661366
/* the following function directly emits the warning */
1367-
warnif_misplaced_tcp_conn(curpx, file, line, args[0], args[1]);
1367+
warnif_misplaced_tcp_req_conn(curpx, file, line, args[0], args[1]);
13681368
LIST_APPEND(&curpx->tcp_req.l4_rules, &rule->list);
13691369
}
13701370
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,
14081408
}
14091409

14101410
/* the following function directly emits the warning */
1411-
warnif_misplaced_tcp_sess(curpx, file, line, args[0], args[1]);
1411+
warnif_misplaced_tcp_req_sess(curpx, file, line, args[0], args[1]);
14121412
LIST_APPEND(&curpx->tcp_req.l5_rules, &rule->list);
14131413
}
14141414
else {

0 commit comments

Comments
 (0)