From 839eddc558d53d7f06f9dce95896602b3e957e73 Mon Sep 17 00:00:00 2001
From: "Peter J. Holzer" <hjp@hjp.at>
Date: Mon, 6 Nov 2006 09:06:39 +0000
Subject: [PATCH] Older perls don't know constant AF_INET6, but don't mind a
 function which is never called.

git-svn-id: https://svn.perl.org/qpsmtpd/branches/0.3x@673 958fd67b-6ff1-0310-b445-bb7760255be9
---
 qpsmtpd-forkserver | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/qpsmtpd-forkserver b/qpsmtpd-forkserver
index 67b0889..5d8d8b4 100755
--- a/qpsmtpd-forkserver
+++ b/qpsmtpd-forkserver
@@ -230,9 +230,9 @@ while (1) {
     my ($port, $iaddr) = ($server->sockdomain == AF_INET) ? (sockaddr_in($hisaddr)) : (sockaddr_in6($hisaddr));
     my $localsockaddr = getsockname($client);
     my ($lport, $laddr) = ($server->sockdomain == AF_INET) ? (sockaddr_in($localsockaddr)) : (sockaddr_in6($localsockaddr));
-    my $nto_iaddr = ($server->sockdomain == AF_INET) ? (inet_ntoa($iaddr)) : (inet_ntop(AF_INET6, $iaddr));
-    my $ton_iaddr = ($server->sockdomain == AF_INET) ? (inet_aton($iaddr)) : (inet_pton(AF_INET6, $iaddr));
-    my $nto_laddr = ($server->sockdomain == AF_INET) ? (inet_ntoa($laddr)) : (inet_ntop(AF_INET6, $laddr));
+    my $nto_iaddr = ($server->sockdomain == AF_INET) ? (inet_ntoa($iaddr)) : (inet_ntop(AF_INET6(), $iaddr));
+    my $ton_iaddr = ($server->sockdomain == AF_INET) ? (inet_aton($iaddr)) : (inet_pton(AF_INET6(), $iaddr));
+    my $nto_laddr = ($server->sockdomain == AF_INET) ? (inet_ntoa($laddr)) : (inet_ntop(AF_INET6(), $laddr));
     $nto_iaddr =~ s/::ffff://;
     $nto_laddr =~ s/::ffff://;