Add support for Linux VRF via --interface #2024

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants
@bluca
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.

@bagder

bagder approved these changes Oct 28, 2017

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;"

This comment has been minimized.

@bagder

bagder Oct 28, 2017

Member

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.

@bagder

bagder Oct 28, 2017

Member

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.

This comment has been minimized.

@bluca

bluca Oct 28, 2017

Contributor

Sure, makes sense, done.

@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.
@bluca

This comment has been minimized.

Show comment
Hide comment
@bluca

bluca Nov 6, 2017

Contributor

@bagder anything else I can do? Thanks!

Contributor

bluca commented Nov 6, 2017

@bagder anything else I can do? Thanks!

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

@bagder

This comment has been minimized.

Show comment
Hide comment
@bagder

bagder Nov 9, 2017

Member

Merged now, thanks!

Member

bagder commented Nov 9, 2017

Merged now, thanks!

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

@bluca

This comment has been minimized.

Show comment
Hide comment
@bluca

bluca Nov 9, 2017

Contributor

Great, thank you again

Contributor

bluca commented Nov 9, 2017

Great, thank you again

@lock lock bot locked as resolved and limited conversation to collaborators May 10, 2018

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