You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2012/08/31 23:01:14 UTC

[Bug 53809] New: apr_accept never sets remote_ip_unkown

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

          Priority: P2
            Bug ID: 53809
          Assignee: bugs@httpd.apache.org
           Summary: apr_accept never sets remote_ip_unkown
          Severity: normal
    Classification: Unclassified
                OS: FreeBSD
          Reporter: revilones@gmail.com
          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: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 53809] apr_accept never sets remote_ip_unkown

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53809

Christophe JAILLET <ch...@wanadoo.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|Core                        |APR
            Version|2.2.3                       |HEAD
           Assignee|bugs@httpd.apache.org       |bugs@apr.apache.org
            Product|Apache httpd-2              |APR

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

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org