Commit Diff
Diff:
1b77673cb35200927c99dbf091bc8546a72579a6
865e4ace54a95d4ce62427f7778efda25a83aa0b
Commit:
865e4ace54a95d4ce62427f7778efda25a83aa0b
Tree:
07f0c1f86357a14e8975185b9f0000ecee8b4ecf
Author:
pjp <pjp@delphinusdns.org>
Committer:
pjp <pjp@delphinusdns.org>
Date:
Tue Jul 14 16:46:32 2020 UTC
Message:
this fix makes IPv6 in forwarding mode work reliably.
blob - 45282ebe3840eea91c195dd0cee23400a6fa61b5
blob + e31e007d0abb0d32d2d3bee071bde17da20e0b1e
--- forward.c
+++ forward.c
@@ -27,7 +27,7 @@
*/
/*
- * $Id: forward.c,v 1.24 2020/07/14 16:14:35 pjp Exp $
+ * $Id: forward.c,v 1.25 2020/07/14 16:46:32 pjp Exp $
*/
#include <sys/types.h>
@@ -948,7 +948,7 @@ newqueue:
memcpy(&fwq1->oldhost4, &sforward->from4, sizeof(struct sockaddr_in));
break;
case AF_INET6:
- memcpy(&fwq1->oldhost6, &sforward->from6, sizeof(struct sockaddr_in));
+ memcpy(&fwq1->oldhost6, &sforward->from6, sizeof(struct sockaddr_in6));
break;
}
@@ -1459,7 +1459,7 @@ endimsg:
if (sendto(so, buf, len, 0, (struct sockaddr *)&fwq->oldhost4, tolen) < 0)
dolog(LOG_INFO, "sendto: %s\n", strerror(errno));
break;
- default:
+ case AF_INET6:
tolen = sizeof(struct sockaddr_in6);
if (sendto(so, buf, len, 0, (struct sockaddr *)&fwq->oldhost6, tolen) < 0)
dolog(LOG_INFO, "sendto: %s\n", strerror(errno));
repomaster@centroid.eu