Add support for Linux VRF via --interface #2024

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants
Contributor

bluca commented Oct 26, 2017

The --interface command already uses SO_BINDTODEVICE on Linux, but it
tries to parse it as an interface or IP address first, which fails in
case the user passes a VRF.
Try to immediately use the socket option and only try to parse it as a
fallback instead.
Update the documentation to mention this feature, and that it requires
the binary to be ran by root or with CAP_NET_RAW capabilities.

lib/connect.c
+ if(setsockopt(sockfd, SOL_SOCKET, SO_BINDTODEVICE,
+ dev, (curl_socklen_t)strlen(dev) + 1) != 0) {
+ error = SOCKERRNO;
+ infof(data, "SO_BINDTODEVICE %s failed with errno %d: %s;"
@bagder

bagder Oct 28, 2017

Owner

What would you say about removing this infof() call? With this done even more frequently, it will be shown for basically all users of this option and it feels a bit... much to me.

@bluca

bluca Oct 28, 2017

Contributor

Sure, makes sense, done.

Add support for Linux VRF via --interface
The --interface command already uses SO_BINDTODEVICE on Linux, but it
tries to parse it as an interface or IP address first, which fails in
case the user passes a VRF.
Try to immediately use the socket option and only try to parse it as a
fallback instead.
Update the documentation to mention this feature, and that it requires
the binary to be ran by root or with CAP_NET_RAW capabilities.
Contributor

bluca commented Nov 6, 2017

@bagder anything else I can do? Thanks!

@bagder bagder closed this in 32828cc Nov 9, 2017

Owner

bagder commented Nov 9, 2017

Merged now, thanks!

@bluca bluca deleted the bluca:linux_vrf branch Nov 9, 2017

Contributor

bluca commented Nov 9, 2017

Great, thank you again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment