net: Avoid calling getnameinfo when formatting IPv4 addresses in CNetAddr::ToStringIP #21564

pull practicalswift wants to merge 2 commits into bitcoin:master from practicalswift:simplify-ipv4-address-formatting changing 1 files +6 −3
  1. practicalswift commented at 8:18 am on April 1, 2021: contributor
    Avoid calling getnameinfo when formatting IPv4 addresses in CNetAddr::ToStringIP.
  2. net: Add IPv4ToString (we already have IPv6ToString) 5858057384
  3. net: Avoid calling getnameinfo when formatting IPv4 addresses in CNetAddr::ToStringIP 58580a827d
  4. fanquake added the label P2P on Apr 1, 2021
  5. 0xB10C commented at 9:29 am on April 1, 2021: member

    Concept ACK: nice cleanup.

    Any reason why this wasn’t previously in the NET_IPV4 case?

  6. Empact commented at 5:14 am on April 2, 2021: member

    Concept ACK

    This was introduced in #19845 /cc @vasild

    nit: I would not extract IPv4ToString - IPv6ToString is justified by its being called in more than one place.

  7. vasild approved
  8. vasild commented at 4:01 pm on April 2, 2021: member
    ACK 58580
  9. vasild commented at 4:06 pm on April 2, 2021: member

    Any reason why this wasn’t previously in the NET_IPV4 case?

    The code before #19845 had this logic: “first try getnameinfo() and only if it does not work, then format manually (both ipv4 and ipv6)”. I kept that logic in #19845 assuming that the reason is “getnameinfo() knows best”.

  10. practicalswift commented at 8:54 pm on April 4, 2021: contributor
    @vasild Thanks for reviewing! I think you ACK:ed an incomplete commit hash :)
  11. vasild approved
  12. vasild commented at 1:22 pm on April 12, 2021: member
    ACK 58580a827d10c0675c3483e2aeca1d3ab8050ae0
  13. naumenkogs commented at 9:45 am on April 16, 2021: member
    ACK 58580a827d10c0675c3483e2aeca1d3ab8050ae0
  14. 0xB10C commented at 11:35 am on April 16, 2021: member
    ACK 58580a827d10c0675c3483e2aeca1d3ab8050ae0
  15. practicalswift commented at 7:25 pm on April 21, 2021: contributor
    Anything left to do here? :)
  16. MarcoFalke merged this on Apr 22, 2021
  17. MarcoFalke closed this on Apr 22, 2021

  18. sidhujag referenced this in commit 853f77631a on Apr 22, 2021
  19. laanwj referenced this in commit 7b87fca930 on May 17, 2021
  20. PastaPastaPasta referenced this in commit 3b32d90ab3 on Jun 27, 2021
  21. PastaPastaPasta referenced this in commit 6c116c3552 on Jun 28, 2021
  22. PastaPastaPasta referenced this in commit 841d791209 on Jun 29, 2021
  23. PastaPastaPasta referenced this in commit d289b8c056 on Jul 1, 2021
  24. PastaPastaPasta referenced this in commit a569441cf1 on Jul 1, 2021
  25. PastaPastaPasta referenced this in commit a43fdd469a on Jul 15, 2021
  26. random-zebra referenced this in commit b4751e10ce on Aug 11, 2021
  27. gades referenced this in commit fec5096489 on Apr 30, 2022
  28. gwillen referenced this in commit ba678ce2f3 on Jun 1, 2022
  29. DrahtBot locked this on Aug 18, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2025-04-09 18:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me