[fpc-devel]ipv6 patch

Johannes Berg johannes at sipsolutions.com
Fri Nov 21 22:56:23 CET 2003


On Fri, 2003-11-21 at 22:42, Johannes Berg wrote:
> Works as far as I can determine from making a connection with my local
> ftp server running on ipv6 and sending/reading data.

See attached test program, very crude and you need a ftp server running
on a ipv6 capable machine at ::1.

> Sock2Text doesn't seem to work though, not sure why. However, using API
> calls with my structures works -- would you consider to apply it
> (knocking another local patch off my list)? Or is anything wrong with it
> that I should fix first?

Fixed, please apply patch, see bug 2800.

johannes
-- 
http://www.sipsolutions.de/
GnuPG key: http://www.sipsolutions.de/keys/JohannesBerg.asc
  Key-ID: 9AB78CA5 Johannes Berg <johannes at sipsolutions.de>
  Fingerprint = AD02 0176 4E29 C137 1DF6 08D2 FC44 CF86 9AB7 8CA5
-------------- next part --------------
program ip6test;

uses
  sockets,
  unix,
  errors,
  baseunix;

var
  dest: TInetSockAddr6;
  sock: LongInt;
  s: shortstring;
  i: integer;
  t1,t2:text;

begin
  with dest do begin
    sin6_family := PF_INET6;
    sin6_port   := 5376; // = htons(21)
    sin6_addr.s6_addr32[0] := 0;
    sin6_addr.s6_addr32[1] := 0;
    sin6_addr.s6_addr32[2] := 0;
    sin6_addr.s6_addr32[3] := 0;
    sin6_addr.s6_addr[15] := 1;
  end;
  sock := socket(PF_INET6, SOCK_STREAM, 6 {TCP});

  sock2text(sock,t1,t2);  

  if Connect(sock, dest, sizeof(dest)) then begin
    readln(t1, s);
    writeln(s);
    writeln(t2, 'QUIT');
    readln(t1, s);
    writeln(s);
  end else begin
    writeln('not connected: ',getlasterror, ': ', StrError(getlasterror));
  end;
  closesocket(sock);
end.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 194 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20031121/3522030a/attachment.sig>


More information about the fpc-devel mailing list