Replication and net box interface bind#11984
Merged
locker merged 4 commits intotarantool:masterfrom Nov 18, 2025
Merged
Conversation
a804682 to
9eb25b3
Compare
It's been used by the applier originally, but in commit 0486a48 ("replication: add remote peer connection timeout"), the function is only used in the coio test. Let's drop it completely and rename the `coio_connect_timeout` to `coio_connect`. Follows-up tarantool#8380 NO_DOC=refactoring NO_CHANGELOG=refactoring
0122c9f to
1f015be
Compare
1f015be to
20763b4
Compare
3aac458 to
58d0185
Compare
b7f818e to
1568bf4
Compare
locker
reviewed
Nov 13, 2025
1568bf4 to
89c82ba
Compare
89c82ba to
883beff
Compare
locker
approved these changes
Nov 17, 2025
AArdeev
approved these changes
Nov 17, 2025
changelogs/unreleased/gh-11803-uri-interface-option-in-box-cfg-replication.md
Outdated
Show resolved
Hide resolved
c0636e7 to
5fab610
Compare
The parameter allows to specify the `src` field of packets sent using the connection. Needed for tarantool#11803 NO_DOC=internal NO_CHANGELOG=internal
Part of tarantool#11803 @TarantoolBot document Title: introduced the `interface` URI param support in `replication` Now a URI passed to the `box.cfg.replication` can contain `interface` parameter specifying the name of the interface to bind the connection to the URI to. Examples of the `box.cfg.replication` value: - `{uri1, params = {interface = 'enp0s31f6'}}` - `{uri1, uri2, default_params = {interface = 'enp0s31f6'}}` - ``` { uri1, {uri2, params = {interface = 'wlp0s20f3'}}, uri3, default_params = {interface = 'enp0s31f6'} } ```
Closes tarantool#11803 @TarantoolBot document Title: `interface` URI parameter support in `net.box.connect` Now a URI passed to the `net.box.connect` can contain the `interface` param specifying the name of the interface to bind the connection to. Example: `net_box.connect({3301, params = {interface = 'lo'}})`.
5fab610 to
ed205fc
Compare
Contributor
Author
|
Updated the changelogs, actualized the diffdiff --git a/changelogs/unreleased/gh-11803-uri-interface-option-in-box-cfg-replication.md b/changelogs/unreleased/gh-11803-uri-interface-option-in-box-cfg-replication.md
index 5b23121e98..8520d5c790 100644
--- a/changelogs/unreleased/gh-11803-uri-interface-option-in-box-cfg-replication.md
+++ b/changelogs/unreleased/gh-11803-uri-interface-option-in-box-cfg-replication.md
@@ -1,5 +1,5 @@
## feature/box
-* Now the `interface` parameter can be used in `box.cfg.replication` URIs.
- It allows to specify the interface to bind the connections to a URI to
+* The `interface` parameter can now be used in `box.cfg.replication` URIs.
+ It allows specifying the network interface to bind to for URI connections
(gh-11803).
diff --git a/src/lib/core/coio.c b/src/lib/core/coio.c
index 3729bbb0db..446bcf629d 100644
--- a/src/lib/core/coio.c
+++ b/src/lib/core/coio.c
@@ -81,7 +81,8 @@ ipv6_scope(const struct sockaddr *addr)
/**
* Bind the given socket fd stream to the given interface (by name). The
- * bind parameters are selected based on the given destination address.
+ * interface IP is selected based on the given address family and IPv6
+ * scope (if the address family is IPv6).
*
* @retval 0 success
* @retval -1 error
@@ -115,8 +116,6 @@ coio_bind_iface(int fd, const char *ifname, int remote_af,
sin->sin_port = htons(0); /* Bind to any port. */
} else {
assert(remote_af == AF_INET6);
- struct sockaddr_in6 *sin6 =
- (struct sockaddr_in6 *)iface->ifa_addr;
/*
* We are interested only in interface addresses whose
* scope matches the remote address we want to connect
@@ -133,6 +132,8 @@ coio_bind_iface(int fd, const char *ifname, int remote_af,
* to specify an IPv6 address with a zone ID specified
* in Tarantool (see the URI parser in src/lib/uri).
*/
+ struct sockaddr_in6 *sin6 =
+ (struct sockaddr_in6 *)iface->ifa_addr;
bind_addr_len = sizeof(*sin6);
bind_addr = iface->ifa_addr;
sin6->sin6_port = htons(0); /* Bind to any port. */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #11803