Le 23/10/2012 19:40, Sam MacPherson a �crit :
> Okay, this
>
> /**
> get_client_ip : void -> string
> <doc>Get the connected client IP</doc>
> **/
> static value get_client_ip() {
> char buf[15];
> char *ipaddr = (char
> *) &CONTEXT()->r->connection->remote_addr->sa.sin.sin_addr;
> sprintf(buf, "%d.%d.%d.%d",
> ipaddr[0], ipaddr[1], ipaddr[2], ipaddr[3]);
> return alloc_string(&buf);
> }
>
> returns 0.0.0.0 .
Uhm... Looks like an issue with either Apache not filling the data
correctly, or the request_rec structure having changed between the
headers you're compiling against and the Apache version you running with...
What does alloc_string(...connection->remote_ip) return instead ?
We stopped using it when we noticed it used the X-Forwarding-IP and thus
allowed IP spoofing.
Best,
Nicolas