In case of IPv4 to IPv6 translation, give back IPv4. - geomyidae - A small C-based gopherd.
git clone git://bitreich.org/geomyidae/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/geomyidae/
Log
Files
Refs
Tags
README
LICENSE
---
commit f4e4537ed6597fecff177869993b0c334b257d64
parent 67eb195e1924b652b193e6332c1ce8f00fd1f2c9
Author: Christoph Lohmann <20h@r-36.net>
Date:   Fri, 26 Jan 2018 13:54:06 +0100

In case of IPv4 to IPv6 translation, give back IPv4.

Diffstat:
  M main.c                              |       3 +++

1 file changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/main.c b/main.c
@@ -512,6 +512,9 @@ main(int argc, char *argv[])
                                 sizeof(clienth), clientp, sizeof(clientp),
                                 NI_NUMERICHOST|NI_NUMERICSERV);
 
+                if (!strncmp(clienth, "::ffff:", 7))
+                        memmove(clienth, clienth+7, strlen(clienth)-6);
+
                 if (loglvl & CONN)
                         logentry(clienth, clientp, "-", "connected");