make dnswin use makeaddrinfov
authorplugwash <plugwash@p10link.net>
Mon, 13 Apr 2009 00:12:13 +0000 (00:12 +0000)
committerplugwash <plugwash@p10link.net>
Mon, 13 Apr 2009 00:12:13 +0000 (00:12 +0000)
git-svn-id: file:///svnroot/lcore/trunk@45 b1de8a11-f9be-4011-bde0-cc7ace90066a

dnswin.pas

index 19eabe46124018816564f0b71d7a575ffcc69adf..573c888a76c8a83369bfc0366d3b46ca63e87962 100755 (executable)
@@ -233,17 +233,7 @@ var
   getnameinforesult : integer;\r
 begin\r
 \r
-  if ip.family = AF_INET then begin\r
-    sa.InAddr.family := AF_INET;\r
-    sa.InAddr.port := 1;\r
-    sa.InAddr.addr := ip.ip;\r
-  end else {$ifdef ipv6}if ip.family = AF_INET6 then begin\r
-    sa.InAddr6.sin6_family  := AF_INET6;\r
-    sa.InAddr6.sin6_port := 1;\r
-    sa.InAddr6.sin6_addr := ip.ip6;\r
-  end else{$endif} begin\r
-    raise exception.create('unrecognised address family');\r
-  end;\r
+  makeinaddrv(sa,ip);
   populateprocvars;\r
   setlength(result,1025);\r
   getnameinforesult := getnameinfo(@sa,sizeof(tinetsockaddrv),pchar(result),length(result),nil,0,0);\r