bitcoin/depends/packages
Ava Chow c33eb2360e
Merge bitcoin/bitcoin#30043: net: Replace libnatpmp with built-in PCP+NATPMP implementation
5c7cacf649 ci: Remove natpmp build option and libnatpmp dependency (laanwj)
7e7ec984da doc: Remove mention of natpmp build options (laanwj)
061c3e32a2 depends: Drop natpmp and associated option from depends (laanwj)
20a18bf6aa build: Drop libnatpmp from build system (laanwj)
7b04709862 qt: Changes for built-in PCP+NAT-PMP (laanwj)
52f8ef66c6 net: Replace libnatpmp with built-in NATPMP+PCP implementation in mapport (laanwj)
97c97177cd net: Add PCP and NATPMP implementation (laanwj)
d72df63d16 net: Use GetLocalAddresses in Discover (laanwj)
e02030432b net: Add netif utility (laanwj)
754e425438 crypto: Add missing WriteBE16 function (laanwj)

Pull request description:

  Continues #30005. Closes #17012..

  This PR adds PCP (Port Control Protocol) from [RFC6887](https://datatracker.ietf.org/doc/html/rfc6887).  This adds, in addition to the existing IPv4 port mapping (which now uses PCP, with fallback to NAT-PMP), support for IPv6 pinholing-that is, opening a port on the firewall to make it reachable.

  PCP, like NAT-PMP is a simple UDP-based protocol, and the implementation is self-contained, so this gets rid of lthe libnatpnp dependency without adding a new one. It should otherwise be a drop-in replacement. NAT-PMP fallback is implemented so this will not make router support worse.

  For now it is disabled by default, though in the future (not in this PR) we could consider enable it by default to increase the number of connectable nodes without adding significant attack surface.

  To test:
  ```bash
  bitcoind -regtest -natpmp=1 -debug=net
  ```

  (most of the changes in this PR are, ironically, removing the libnatpmp dependency and associated build system and build docs)

  ## TODO

  - [x] Default gateway discovery on Linux / FreeBSD
  - [x] Default gateway discovery on Windows
  - [x] Default gateway discovery on MacOS
  - [x] Either solve FreeBSD compile issue (probably upstream issue) or remove FreeBSD support

  ## Things to consider for follow-up PRs

  - https://github.com/bitcoin/bitcoin/pull/30043#discussion_r1658764974 avoid unreachable nets (not given to -onlynet=)

  - https://github.com/bitcoin/bitcoin/pull/30043#discussion_r1658949236 could announce an addr:port where we do not listen (no -bind)

  - https://github.com/bitcoin/bitcoin/pull/30043#discussion_r1684368824 could announce the wrong port because it uses GetListenPort()

  - https://github.com/bitcoin/bitcoin/pull/30043#discussion_r1679709347 if we requested one port but another was assigned, then which one to use in the renewal?

  - https://github.com/bitcoin/bitcoin/pull/30043#discussion_r1772017020 Use `GetAdapterAddresses` to discover local addresses for Windows

ACKs for top commit:
  Sjors:
    ACK 5c7cacf649
  achow101:
    ACK 5c7cacf649
  vasild:
    ACK 5c7cacf649

Tree-SHA512: e35b69e56d5f5449a3d48a799f9b7b65107c65eeb3e245c2c1e9d42221e469ca5ead90afae423160601cd664dd553a51c859e04f4492f335b064aae3bf23e3bc
2024-09-30 16:27:47 -04:00
..
bdb.mk depends: always configure with --with-pic 2024-03-14 15:41:17 +00:00
boost.mk depends: Update Boost download link 2024-06-03 09:49:34 +01:00
capnp.mk depends: Fix reproducibility when building with MULTIPROCESS=1 2024-09-23 13:24:08 +01:00
expat.mk depends: switch to building expat with CMake 2024-07-23 15:37:01 +01:00
fontconfig.mk depends: switch fontconfig to .tar.gz 2024-04-19 13:01:09 +01:00
freetype.mk depends: Cleanup postprocess commands after switching to CMake 2024-07-25 11:59:18 +01:00
libevent.mk depends: build libevent with -D_GNU_SOURCE 2024-09-03 10:16:52 +01:00
libmultiprocess.mk depends: Fix reproducibility when building with MULTIPROCESS=1 2024-09-23 13:24:08 +01:00
libXau.mk depends: switch libXau to .tar.gz 2024-04-19 13:01:09 +01:00
libxcb.mk libxcb: use a patch instead of sed 2022-07-29 14:02:23 +01:00
libxcb_util.mk depends: switch libxcb_util to .tar.gz 2024-04-19 13:01:09 +01:00
libxcb_util_image.mk depends: switch libxcb_util_image to .tar.gz 2024-04-19 13:01:10 +01:00
libxcb_util_keysyms.mk depends: switch libxcb_util_keysyms to .tar.gz 2024-04-19 13:01:10 +01:00
libxcb_util_render.mk depends: switch libxcb_util_render to .tar.gz 2024-04-19 13:01:10 +01:00
libxcb_util_wm.mk depends: switch libxcb_util_wm to .tar.gz 2024-04-19 13:01:10 +01:00
libxkbcommon.mk build: suppress array-bounds errors in libxkbcommon 2022-06-23 17:29:31 +01:00
miniupnpc.mk Revert "depends: Fetch miniupnpc sources from an alternative website" 2024-08-07 15:31:45 -04:00
native_capnp.mk depends: Build native_capnp package with CMake 2023-12-04 14:39:59 +00:00
native_libmultiprocess.mk depends: Update libmultiprocess library for cmake headers target 2024-09-23 16:03:04 -04:00
packages.mk depends: Drop natpmp and associated option from depends 2024-09-30 11:37:55 +02:00
qrencode.mk depends: cleanup after qrencode build 2024-07-25 12:02:48 +01:00
qt.mk cmake: Add cross-compiling support 2024-08-16 21:19:11 +01:00
sqlite.mk depends: remove -g from sqlite debug flags 2024-04-02 17:12:25 +01:00
systemtap.mk Revert "depends: systemtap: remove variadic params that trigger compiler warnings" 2024-01-04 17:11:37 +00:00
xcb_proto.mk depends: xcb-proto 1.15.2 2023-07-18 11:27:24 +01:00
xproto.mk depends: switch xproto to .tar.gz 2024-04-19 13:01:09 +01:00
zeromq.mk depends: Fix CMake-generated libzmq.pc file 2024-08-28 12:00:49 +01:00