mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-20 13:21:29 +02:00
In http_7239_extract_{ipv4,ipv6}, we declare a local buffer in order to use inet_pton() since it requires a valid destination argument (cannot be NULL). Then, if the caller provided <ip> argument, we copy inet_pton() result (from local buffer to <ip>). In fact when the caller provides <ip>, we may directly use <ip> as inet_pton() dst argument to avoid an useless copy. Thus the local buffer is only relevant when the user doesn't provide <ip>. While at it, let's add a missing testcase for the rfc7239_n2nn converter (to check that http_7239_extract_ipv4() with <ip> provided works properly) This could be backported in 2.8 with b2bb925 ("MINOR: proxy/http_ext: introduce proxy forwarded option")