ports/www/pound/files/patch-svc.c
Alexey Dokuchaev c7369f228e - Update `www/pound' to version 2.8 and unbreak against
newish OpenSSL versions [*]
- Add a handful of useful patches from upstream SRPM
- Use upstream program description for COMMENT (shorter)
- Utilize its own installation target and only post-install
  documentation files; install sample configuration file
- Consummate conversion to option helpers and transfer
  maintainership to the new volunteer

PR:	234556 [*]
2019-03-30 15:47:42 +00:00

29 lines
783 B
C

--- svc.c.orig 2018-05-11 10:16:05 UTC
+++ svc.c
@@ -273,6 +273,7 @@ addr2str(char *const res, const int res_len, const str
char buf[MAXBUF];
int port;
void *src;
+ char *p = buf;
memset(res, 0, res_len);
#ifdef HAVE_INET_NTOP
@@ -298,10 +299,15 @@ addr2str(char *const res, const int res_len, const str
port = 0;
break;
}
- if(no_port)
- snprintf(res, res_len, "%s", buf);
+ // Strip off the IPv6 prefix
+ if (strncmp(buf, "::ffff:", 7) == 0)
+ {
+ p = buf + 7;
+ }
+ if (no_port)
+ snprintf(res, res_len, "%s", p);
else
- snprintf(res, res_len, "%s:%d", buf, port);
+ snprintf(res, res_len, "%s:%d", p, port);
#else
#error "Pound needs inet_ntop()"
#endif