diff options
| author | Laurent Bercot <ska-skaware@skarnet.org> | 2026-02-10 12:45:55 +0000 |
|---|---|---|
| committer | Laurent Bercot <ska-skaware@skarnet.org> | 2026-02-10 12:45:55 +0000 |
| commit | 20ffab64abed12f46888ef4a7cffa153745c592f (patch) | |
| tree | a28bc7c2698d16f48c7dd4275a65ce9aba88a68c | |
| parent | 3fcda96986dd7448fd26d28c7c9f03e9e0f673e6 (diff) | |
| download | smtpd-starttls-proxy-20ffab64abed12f46888ef4a7cffa153745c592f.tar.gz | |
Fix mapping in tcpto, fix diagnostic in smtproutes
| -rw-r--r-- | src/qmail-remote/qmailr_tcpto.c | 3 | ||||
| -rw-r--r-- | src/qmail-remote/smtproutes.c | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/qmail-remote/qmailr_tcpto.c b/src/qmail-remote/qmailr_tcpto.c index 3b7ffeb..c015d21 100644 --- a/src/qmail-remote/qmailr_tcpto.c +++ b/src/qmail-remote/qmailr_tcpto.c @@ -44,7 +44,7 @@ int qmailr_tcpto_match (char const *ip, int is6) uint32_t iplen = is6 ? 16 : 4 ; uint32_t width = iplen + 12 ; int r = 0 ; - char const *map ; + char *map ; char const *p ; struct stat st ; int fd = openc_read(file) ; @@ -69,6 +69,7 @@ int qmailr_tcpto_match (char const *ip, int is6) r = tai_sec(&when) < ((60 + (getpid() & 31)) << 6) ; /* don't ask me, ask djb */ } } + munmap(map, st.st_size) ; end: fd_close(fd) ; return r ; diff --git a/src/qmail-remote/smtproutes.c b/src/qmail-remote/smtproutes.c index 8daa1a7..c223f85 100644 --- a/src/qmail-remote/smtproutes.c +++ b/src/qmail-remote/smtproutes.c @@ -160,7 +160,9 @@ static inline void smtproutes_compile (int fdr, int fdw) { if (relaypos || relayend > 2 + relaypos) { - LOLDEBUG("adding entry: %.*s -> %.*s", (int)relaypos, sa.s, (int)(relayend - relaypos), sa.s + relaypos) ; + uint16_t port ; + uint16_unpack_big(sa.s + relaypos, &port) ; + LOLDEBUG("adding entry: %.*s -> %.*s port %hu", (int)relaypos, sa.s, (int)(relayend - relaypos - 2), sa.s + relaypos + 2, port) ; if (!cdbmake_add(&cm, sa.s, relaypos, sa.s + relaypos, relayend - relaypos)) qmailr_tempusys("cdbmake_add") ; } |
