tIn case of IPv4 to IPv6 translation, give back IPv4. - geomyidae - A small C-based gopherd. (gopher://bitreich.org/1/scm/geomyidae)
git clone git://r-36.net/geomyidae
Log
Files
Refs
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:
  main.c                              |       3 +++

1 file changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/main.c b/main.c
t@@ -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");