Hi,

While experimenting with counters in a dual-stack setup, I noticed that 
src_inc_gpc0 does not seem to work for IPv4 clients looked up against 
type ipv6 stick-tables. The following configuration:

 global
     log 127.0.0.1    local0
     user haproxy
     group haproxy
     stats socket /var/run/haproxy.sock user root group root level admin
 
 frontend test
     mode http
     bind 127.0.0.1:8888
     bind ::1:8888
     stick-table type ipv6 size 1k expire 1h store gpc0,http_req_rate(5m)
     tcp-request connection track-sc0 src
     redirect prefix http://example.com if { src_inc_gpc0 ge 0 }

with a 1.5-dev22 instance and the following scenario:

 $ for i in {1..4}; do curl -6 http://localhost:8888/; done
 $ for i in {1..4}; do curl -4 http://localhost:8888/; done

yields these results:

 $ echo show table test | sudo socat STDIO /var/run/haproxy.sock
 # table: test, type: ipv6, size:1024, used:2
 0x17efd50: key=::1 use=0 exp=3596869 gpc0=4 http_req_rate(300000)=4
 0x17effb0: key=::ffff:127.0.0.1 use=0 exp=3598516 gpc0=0 
http_req_rate(300000)=4

Notice that while the http_req_rate is properly calculated in both cases, gpc0
is not incremented for the mapped IPv4 client. Using sc0_inc_gpc0 on the 
other hand works as expected.

Any ideas?

Regards,
Apollon

Reply via email to