[fpc-pascal] fprecvfrom for IPv6?

Klaus Hartnegg hartnegg at gmx.de
Sun Aug 2 12:50:07 CEST 2015


How can fprecvfrom work with IPv6?

It returns the address of the sender in a record sockaddr, which only 
has space for an IPv4 address.

Is there an undocumented variant in which psockaddr points to 
sockaddr_in6 instead of sockaddr?

Or is this already the case in the existing fprecvfrom?

One of my programs suddenly claims that fprecvfrom returned an address 
record with size 28 bytes instead of 16 (in fromlen:pSockLen), when it 
runs in Redhat (using xinetd) instead of Ubuntu (using openbsd-inetd), 
when receiving an UDP packet. Interestingly sizeof(sockaddr_in6) is 28. 
Probably not a coincidence, but I whish it were documented, because I 
don't want to develop software based on guessing.

Btw. what does fpcrectfrom do when fromlen^ is smaller than the amount 
of data that it wants to copy to psockaddr^? Buffer overflow?


More information about the fpc-pascal mailing list