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.

39 lines
1.3 KiB

  1. From fab41521192c6f62f0284faf53d6ad40955ef3db Mon Sep 17 00:00:00 2001
  2. From: David CARLIER <devnexen@gmail.com>
  3. Date: Thu, 24 Mar 2016 09:22:36 +0000
  4. Subject: [PATCH 2/4] CLEANUP: connection: fix double negation on memcmp()
  5. Nothing harmful in here, just clarify that it applies to the whole
  6. expression.
  7. (cherry picked from commit 42ff05e2d3d10e8a1e070e66e8883c5eabe196d7)
  8. (cherry picked from commit c4809151b4c9ccc312cb451e99fd556e867242fc)
  9. ---
  10. src/connection.c | 4 ++--
  11. 1 file changed, 2 insertions(+), 2 deletions(-)
  12. diff --git a/src/connection.c b/src/connection.c
  13. index 09fd04e..af18878 100644
  14. --- a/src/connection.c
  15. +++ b/src/connection.c
  16. @@ -289,7 +289,7 @@ int conn_recv_proxy(struct connection *conn, int flag)
  17. if (trash.len < 9) /* shortest possible line */
  18. goto missing;
  19. - if (!memcmp(line, "TCP4 ", 5) != 0) {
  20. + if (memcmp(line, "TCP4 ", 5) == 0) {
  21. u32 src3, dst3, sport, dport;
  22. line += 5;
  23. @@ -330,7 +330,7 @@ int conn_recv_proxy(struct connection *conn, int flag)
  24. ((struct sockaddr_in *)&conn->addr.to)->sin_port = htons(dport);
  25. conn->flags |= CO_FL_ADDR_FROM_SET | CO_FL_ADDR_TO_SET;
  26. }
  27. - else if (!memcmp(line, "TCP6 ", 5) != 0) {
  28. + else if (memcmp(line, "TCP6 ", 5) == 0) {
  29. u32 sport, dport;
  30. char *src_s;
  31. char *dst_s, *sport_s, *dport_s;
  32. --
  33. 2.7.3