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.

44 lines
2.3 KiB

  1. --- a/src/redir.c
  2. +++ b/src/redir.c
  3. @@ -3358,14 +3358,17 @@ int redir_main(struct redir_t *redir,
  4. }
  5. #define redir_memcopy(msgtype) \
  6. + do { \
  7. redir_challenge(challenge); \
  8. redir_chartohex(challenge, hexchal, REDIR_MD5LEN); \
  9. msg.mtype = msgtype; \
  10. memcpy(conn.s_state.redir.uamchal, challenge, REDIR_MD5LEN); \
  11. - if (_options.debug) syslog(LOG_DEBUG, "%s(%d): ---->>> resetting challenge: %s", __FUNCTION__, __LINE__, hexchal)
  12. + if (_options.debug) syslog(LOG_DEBUG, "%s(%d): ---->>> resetting challenge: %s", __FUNCTION__, __LINE__, hexchal); \
  13. + } while (0)
  14. #ifdef USING_IPC_UNIX
  15. #define redir_msg_send(msgopt) \
  16. + do { \
  17. msg.mdata.opt = msgopt; \
  18. memcpy(&msg.mdata.address, address, sizeof(msg.mdata.address)); \
  19. memcpy(&msg.mdata.baddress, baddress, sizeof(msg.mdata.baddress)); \
  20. @@ -3375,9 +3378,11 @@ int redir_main(struct redir_t *redir,
  21. syslog(LOG_ERR, "%s: write() failed! msgfd=%d type=%ld len=%d", \
  22. strerror(errno), redir->msgfd, msg.mtype, (int)sizeof(msg.mdata)); \
  23. return redir_main_exit(&socket, forked, rreq); \
  24. - }
  25. + } \
  26. + } while (0)
  27. #else
  28. #define redir_msg_send(msgopt) \
  29. + do { \
  30. msg.mdata.opt = msgopt; \
  31. memcpy(&msg.mdata.address, address, sizeof(msg.mdata.address)); \
  32. memcpy(&msg.mdata.baddress, baddress, sizeof(msg.mdata.baddress)); \
  33. @@ -3387,7 +3392,8 @@ int redir_main(struct redir_t *redir,
  34. syslog(LOG_ERR, "%s: msgsnd() failed! msgid=%d type=%ld len=%d", \
  35. strerror(errno), redir->msgid, msg.mtype, (int)sizeof(msg.mdata)); \
  36. return redir_main_exit(&socket, forked, rreq); \
  37. - }
  38. + } \
  39. + } while (0)
  40. #endif
  41. /*