net: Quiet down logging when router doesn't support natpmp/pcp #33311

pull laanwj wants to merge 1 commits into bitcoin:master from laanwj:2025-10-pcp-logging changing 1 files +2 −2
  1. laanwj commented at 7:27 PM on September 4, 2025: member

    When the router doesn't support natpmp and PCP, one'd normally expect the UDP packet to be ignored, and hit a time out. This logs a message that is already in the debug category. However, there's also the case in which sending an UDP packet causes a ICMP response (type 3, code 3 "port unreachable"). This is returned to user space as "connection refused" (despite UDP having no concept of connections).

    Move the warnings from Send and Recv to debug level too, to reduce log spam in that case.

    Closes #33301.

  2. net: Quiet down logging when router doesn't support natpmp/pcp
    When the router doesn't support natpmp and PCP, one'd normally expect
    the UDP packet to be ignored, and hit a time out. This logs a warning
    that is already in the debug category. However, there's also the case in
    which sending an UDP packet causes a ICMP response. This is returned to
    user space as "connection refused" (despite UDP having no concept of
    connections).
    
    Move the warnings from `Send` and `Recv` to debug level too, to reduce
    log spam in that case.
    
    Closes #33301.
    4f1a4cbccd
  3. DrahtBot added the label P2P on Sep 4, 2025
  4. DrahtBot commented at 7:27 PM on September 4, 2025: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/33311.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process.

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  5. maflcko added this to the milestone 30.0 on Sep 4, 2025
  6. darosior approved
  7. darosior commented at 7:31 PM on September 4, 2025: member

    utACK 4f1a4cbccd784e25f7932f1d0293602ef7f3e814

  8. willcl-ark commented at 7:40 PM on September 4, 2025: member

    utACK 4f1a4cbccd784e25f7932f1d0293602ef7f3e814

    Makes sense to demote this message to Debug level.

  9. mzumsande commented at 8:33 PM on September 4, 2025: contributor

    utACK 4f1a4cbccd784e25f7932f1d0293602ef7f3e814

  10. sipa commented at 9:07 PM on September 4, 2025: member

    utACK 4f1a4cbccd784e25f7932f1d0293602ef7f3e814

  11. davidgumberg commented at 9:07 PM on September 4, 2025: contributor

    Tested ACK https://github.com/bitcoin/bitcoin/commit/4f1a4cbccd784e25f7932f1d0293602ef7f3e814

    Tested on a network where the default gateway does not support NatPMP with -natpmp=1: pcp: Could not receive response: Connection refused on this branch is not printed, on master it is.

    $ mkdir -p /tmp/datadir && ./build/bin/bitcoind -datadir=/tmp/datadir -regtest -natpmp=1 | grep -i pcp 
    

    On master:

    2025-09-04T21:03:19Z [net:warning] pcp: Could not receive response: Connection refused (111)
    2025-09-04T21:03:19Z [net:warning] pcp: Could not receive response: Connection refused (111)
    

    On this branch there is no output.

  12. achow101 commented at 10:16 PM on September 4, 2025: member

    ACK 4f1a4cbccd784e25f7932f1d0293602ef7f3e814

  13. achow101 merged this on Sep 4, 2025
  14. achow101 closed this on Sep 4, 2025

  15. alexanderwiederin referenced this in commit 49e068b15b on Sep 16, 2025
  16. alexanderwiederin referenced this in commit 4b0c2f2a8f on Sep 17, 2025
  17. alexanderwiederin referenced this in commit 2edb618ffe on Sep 17, 2025
  18. stringintech referenced this in commit fb8510ba20 on Sep 17, 2025
  19. luke-jr referenced this in commit 80f9933c7a on Sep 17, 2025
  20. bug-castercv502 referenced this in commit 9f5d12d027 on Sep 28, 2025
  21. yuvicc referenced this in commit d89c6d0002 on Sep 28, 2025
  22. stickies-v referenced this in commit a785fe6759 on Nov 5, 2025
  23. achow101 referenced this in commit c2975f26d6 on Dec 10, 2025
  24. Fabcien referenced this in commit 68c69262d1 on Apr 9, 2026
  25. roqqit referenced this in commit 58defb31a6 on Jun 11, 2026
  26. Kino1994 referenced this in commit 66e657ea2d on Jun 28, 2026
  27. Kino1994 referenced this in commit c39f3d28b1 on Jun 28, 2026
  28. BigcoinBGC referenced this in commit 406ae9283e on Jun 30, 2026
  29. BigcoinBGC referenced this in commit 537254ee8b on Jun 30, 2026
  30. Kino1994 referenced this in commit df26fec355 on Aug 19, 2026
  31. Kino1994 referenced this in commit 4ac6b18be8 on Aug 19, 2026
  32. bitcoin locked this on Sep 4, 2026

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: 2026-09-09 07:56 UTC