Re: [PR] IPv6: properly format an address coming from IPv6 socket as hex in lf_ip
Hi Lukas, On Thu, Apr 18, 2019 at 08:45:18PM +0200, Lukas Tribus wrote: > Hi Willy, > > > On Fri, 8 Mar 2019 at 14:23, PR Bot wrote: > > > > Dear list! > > > > Author: Radek Zajic > > Number of patches: 1 > > > > This is an automated relay of the Github pull request: > >IPv6: properly format an address coming from IPv6 socket as hex in > >lf_ip > > > > Patch title(s): > >IPv6: properly format an address coming from IPv6 socket as hex string > > in lf_ip > > > > Link: > >https://github.com/haproxy/haproxy/pull/59 > > > > Edit locally: > >wget https://github.com/haproxy/haproxy/pull/59.patch && vi 59.patch > > > > Apply locally: > >curl https://github.com/haproxy/haproxy/pull/59.patch | git am - > > > > Description: > >Dear `haproxy` maintainers, > > > >we've recently discovered an > >issue with formatting IPv6 addresses as hex strings (in e.g. > >`%{+X}ci`). This issue occurs e.g. when formatting `unique-id-format` > >as recommended in the docs: `%{+X}o\ %ci:%cp_%fi:%fp_%Ts_%rt:%pid`. > >This pull request proposes a change that properly formats addresses > >from IPv4 sockets as 8-char hex-string and addresses from IPv6 sockets > >as 32-char hex-string. > > [...] > > > For housekeeping purposes: I believe this patch fall through the > cracks (I did not look at it though). You're right. I thought I took it already but very likely I was too busy to spend time figuring what the original issue was and redoing it with a proper commit message :-/ Radek, please have a look at CONTRIBUTING and make sure that your commit message explains what the problem was, what solution you decided on and why it's supposedly the best. Also any hint about the suitability for backporting to stable branches would be welcome. Thanks, Willy
Re: [PR] IPv6: properly format an address coming from IPv6 socket as hex in lf_ip
Hi Willy, On Fri, 8 Mar 2019 at 14:23, PR Bot wrote: > > Dear list! > > Author: Radek Zajic > Number of patches: 1 > > This is an automated relay of the Github pull request: >IPv6: properly format an address coming from IPv6 socket as hex in >lf_ip > > Patch title(s): >IPv6: properly format an address coming from IPv6 socket as hex string in > lf_ip > > Link: >https://github.com/haproxy/haproxy/pull/59 > > Edit locally: >wget https://github.com/haproxy/haproxy/pull/59.patch && vi 59.patch > > Apply locally: >curl https://github.com/haproxy/haproxy/pull/59.patch | git am - > > Description: >Dear `haproxy` maintainers, > >we've recently discovered an >issue with formatting IPv6 addresses as hex strings (in e.g. >`%{+X}ci`). This issue occurs e.g. when formatting `unique-id-format` >as recommended in the docs: `%{+X}o\ %ci:%cp_%fi:%fp_%Ts_%rt:%pid`. >This pull request proposes a change that properly formats addresses >from IPv4 sockets as 8-char hex-string and addresses from IPv6 sockets >as 32-char hex-string. > [...] For housekeeping purposes: I believe this patch fall through the cracks (I did not look at it though). lukas
[PR] IPv6: properly format an address coming from IPv6 socket as hex in lf_ip
Dear list! Author: Radek Zajic Number of patches: 1 This is an automated relay of the Github pull request: IPv6: properly format an address coming from IPv6 socket as hex in lf_ip Patch title(s): IPv6: properly format an address coming from IPv6 socket as hex string in lf_ip Link: https://github.com/haproxy/haproxy/pull/59 Edit locally: wget https://github.com/haproxy/haproxy/pull/59.patch && vi 59.patch Apply locally: curl https://github.com/haproxy/haproxy/pull/59.patch | git am - Description: Dear `haproxy` maintainers, we've recently discovered an issue with formatting IPv6 addresses as hex strings (in e.g. `%{+X}ci`). This issue occurs e.g. when formatting `unique-id-format` as recommended in the docs: `%{+X}o\ %ci:%cp_%fi:%fp_%Ts_%rt:%pid`. This pull request proposes a change that properly formats addresses from IPv4 sockets as 8-char hex-string and addresses from IPv6 sockets as 32-char hex-string. The result looks like this: ``` Mar 8 13:28:21 hostname haproxy[11719]: ::1:38370 [00 01:95E2_0001:1F98_5C825FE5_000 1:2DC7] [1552048101] webfarm webfarm/server1.yourserver.com 0/0/0/0/0/0/0/0 302 183 - - --NN 1/1/0/0/0 0/0 "GET / HTTP/1.1" Mar 8 13:28:21 hostname haproxy[11719]: 127.0.0.1:42268 [7F01:A51C_7F01:1F98_5C825FE5_0002:2DC7] [1552048101] webfarm webfarm/server1.yourserver.com 0/0/0/0/0/0/0/0 302 183 - - --NN 1/1/0/0/0 0/0 "GET / HTTP/1.1 ``` Please also note that in case of an IPv6-bind processing IPv4-packets (e.g. bind to `::`) results in [IPv4-mapped-IPv6 addresses](https://en.wikipedia.org/wiki/ IPv6#IPv4-mapped_IPv6_addresses) in **both text and hex form**, e.g.: ``` Mar 8 13:18:09 hostname haproxy[8586]: :::127.0.0.1:41874 [7F01:A392_7F0 1:1F98_5C825D81_:218A] [1552047489] webfarm webfarm/server1.yourserver.com 0/0/0/0/0/0/1/1 301 219 - - --NN 1/1/0/0/0 0/0 "GET / HTTP/1.1" ``` For the sake of consistency between `inet_ntop` result (IPv4-mapped-IPv6 address) and the hex formatter, the hex representation is kept as 32-char hex string. Comments are welcome. Please consider merging this patch into `master`. Thank you. Radek Zajic [tech.showmax.com](https://tech.showmax.com/) Instructions: This github pull request will be closed automatically; patch should be reviewed on the haproxy mailing list (haproxy@formilux.org). Everyone is invited to comment, even the patch's author. Please keep the author and list CCed in replies. Please note that in absence of any response this pull request will be lost.