Opened 14 years ago

Closed 13 years ago

#233 closed defect (fixed)

getsockname() and getpeername() fail when using high memory

Reported by: rudi Owned by: bird
Priority: normal Milestone: libc-0.6.5
Component: libc Version: 0.6.4
Severity: normal Keywords:
Cc:

Description

The functions getsockname() and getpeername() will fail, if the variable containing the size of "struct sockaddr" is located in high memory.

It is suggested not to pass the address of that variable directly to the IP stack but use an intermediate local instead.

See http://svn.netlabs.org/qt4/ticket/179#comment:4

Change History (12)

comment:1 by bird, 14 years ago

(In [3674]) libsocket: Made it possible to pass sockaddr parameters in high memory to accept, getsockname, bind, connect and getpeername. (untested) References #233.

comment:2 by bird, 14 years ago

(In [3675]) 0.6: Backporting 3674 - part 1. References #233.

comment:3 by bird, 14 years ago

Resolution: fixed
Status: newclosed

(In [3676]) 0.6: Backporting r3674 - part 2. Fixes #233.

comment:4 by Silvan Scherrer, 13 years ago

Resolution: fixed
Status: closedreopened

in my tests with samba and libc064 connect() still does not work when built with -Zhigh-mem

comment:5 by Silvan Scherrer, 13 years ago

Milestone: libc-0.6.4libc-0.6.5

comment:6 by Silvan Scherrer, 13 years ago

as a addition socketpair() doesn't work also when the fd is in high-mem

comment:7 by Silvan Scherrer, 13 years ago

see http://svn.netlabs.org/qt4/ticket/179 for a little testcase. sockname_fail.zip

comment:8 by Silvan Scherrer, 13 years ago

getpeername() always returns -1 now.
http://svn.netlabs.org/libc/changeset?reponame=&new=3674%40trunk%2Flibc%2Fsrc%2Flibsocket%2Fgetpeername.c&old=2446%40trunk%2Flibc%2Fsrc%2Flibsocket%2Fgetpeername.c
the LIBCLOG_RETURN_INT(rc); on line 48 was eliminated by accident i guess

comment:9 by dmik, 13 years ago

No, I guess it was eliminated on purpose, but the last statement should be LIBCLOG_RETURN_INT(rc);. Anyway, for the time being, the hot fix of libc_dll.lib is here ftp://ftp.netlabs.org/pub/odin/test/libc_dll_233_regression_fixed.zip.

comment:10 by bird, 13 years ago

Changesets r3745 and r3746 addresses the regressions. r3747 addresses the socketpair() high memory issue. (0.6 branch)

comment:11 by bird, 13 years ago

r3748 forward ports the changes to the trunk. Case closed.

comment:12 by bird, 13 years ago

Resolution: fixed
Status: reopenedclosed
Version: 0.6.4
Note: See TracTickets for help on using tickets.