You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
2.0 KiB

  1. From 7fc7ebd5785629074297ee324b22e0aee9ad00f9 Mon Sep 17 00:00:00 2001
  2. From: Willy Tarreau <w@1wt.eu>
  3. Date: Tue, 16 Sep 2014 16:21:19 +0200
  4. Subject: [PATCH 13/13] MINOR: config: detect the case where a tcp-request
  5. content rule has no inspect-delay
  6. If a frontend has any tcp-request content rule relying on request contents
  7. without any inspect delay, we now emit a warning as this will randomly match.
  8. This can be backported to 1.5 as it reduces the support effort.
  9. (cherry picked from commit e42bd96d0acc38ea7c546c8de8115ffd1dd6c3f3)
  10. ---
  11. src/cfgparse.c | 23 +++++++++++++++++++++++
  12. 1 file changed, 23 insertions(+)
  13. diff --git a/src/cfgparse.c b/src/cfgparse.c
  14. index 9ff44e9..f723a3a 100644
  15. --- a/src/cfgparse.c
  16. +++ b/src/cfgparse.c
  17. @@ -6998,6 +6998,29 @@ out_uri_auth_compat:
  18. newsrv = newsrv->next;
  19. }
  20. + /* check if we have a frontend with "tcp-request content" looking at L7
  21. + * with no inspect-delay
  22. + */
  23. + if ((curproxy->cap & PR_CAP_FE) && !curproxy->tcp_req.inspect_delay) {
  24. + list_for_each_entry(trule, &curproxy->tcp_req.inspect_rules, list) {
  25. + if (trule->action == TCP_ACT_CAPTURE &&
  26. + !(trule->act_prm.cap.expr->fetch->val & SMP_VAL_FE_SES_ACC))
  27. + break;
  28. + if ((trule->action >= TCP_ACT_TRK_SC0 && trule->action <= TCP_ACT_TRK_SCMAX) &&
  29. + !(trule->act_prm.trk_ctr.expr->fetch->val & SMP_VAL_FE_SES_ACC))
  30. + break;
  31. + }
  32. +
  33. + if (&trule->list != &curproxy->tcp_req.inspect_rules) {
  34. + Warning("config : %s '%s' : some 'tcp-request content' rules explicitly depending on request"
  35. + " contents were found in a frontend without any 'tcp-request inspect-delay' setting."
  36. + " This means that these rules will randomly find their contents. This can be fixed by"
  37. + " setting the tcp-request inspect-delay.\n",
  38. + proxy_type_str(curproxy), curproxy->id);
  39. + err_code |= ERR_WARN;
  40. + }
  41. + }
  42. +
  43. if (curproxy->cap & PR_CAP_FE) {
  44. if (!curproxy->accept)
  45. curproxy->accept = frontend_accept;
  46. --
  47. 1.8.5.5