]> git.ipfire.org Git - thirdparty/curl.git/commit
socket: support binding to interface *AND* IP
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>
Fri, 17 May 2024 11:44:44 +0000 (14:44 +0300)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 4 Jun 2024 21:47:54 +0000 (23:47 +0200)
commit3060557af702dd59155ea703a0790455c2f49a59
tree2a0bfb997d978cfcc56d09a8740a2e7fdbeb378f
parent23fe1a52dc8a2ffd74e19b956927bbccdc07f15f
socket: support binding to interface *AND* IP

Introduce new notation for CURLOPT_INTERFACE / --interface:
ifhost!<interface>!<host>

Binding to an interface doesn't set the address, and an interface can
have multiple addresses.

When binding to an address (without interface), the kernel is free to
choose the route, and it can route through any device that can access
the target address, not necessarily the one with the chosen address.

Moreover, it is possible for different interfaces to have the same IP
address, on which case we need to provide a way to be more specific.

Factor out the parsing part of interface option, and add unit tests:
1663.

Closes #13719
.github/workflows/proselint.yml
docs/libcurl/opts/CURLOPT_INTERFACE.md
lib/cf-socket.c
lib/cf-socket.h
lib/setopt.c
lib/urldata.h
tests/data/Makefile.inc
tests/data/test1663 [new file with mode: 0644]
tests/unit/Makefile.inc
tests/unit/unit1663.c [new file with mode: 0644]