https://issues.apache.org/bugzilla/show_bug.cgi?id=53809

          Priority: P2
            Bug ID: 53809
          Assignee: [email protected]
           Summary: apr_accept never sets remote_ip_unkown
          Severity: normal
    Classification: Unclassified
                OS: FreeBSD
          Reporter: [email protected]
          Hardware: PC
            Status: NEW
           Version: 2.2.3
         Component: Core
           Product: Apache httpd-2

Hello I am new to developing for apache and I have come across what may or may
not be a bug.

>From what i can tell there is a flag in apr_socket_t that is set when the
remote address is unknown however it is only set when it is created and then is
cleared on apr_accept (specifically in network_io/unix/sockets.c). Then later
on when creating the connection structure this field is checked and in the case
that it is unknown a getpeername is performed. 

The problem is that if the syscall accept happens to return back an empty
ipaddr then it is never checked for. Therefore I am proposing that that a check
is added in apr_accept right after the syscall that checks if the returning
ip_addr is unspecified.

I believe the following code would fix the matter. I don't know if anyone else
has had any trouble with this but I came across the issue of having an
unspecified remote_addr and found that this fixed my problem.


    if (memcmp(sa.ipaddr_ptr, generic_inaddr_any, sa.ipaddr_len)) 
        (*new)->remote_addr_unknown = 0; 
    else 
        (*new)->remote_addr_unknown = 1;


Unfortunately I am heading out on vacation all next week so I wont be back
until next monday but I figured I would send this out now to see what you all
think about it.

Thanks,

Revilones

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to