Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Linux VRF via --interface #2024

Closed
wants to merge 1 commit into from
Closed

Conversation

bluca
Copy link
Contributor

@bluca 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 Outdated
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;"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, makes sense, done.

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
Copy link
Contributor Author

bluca commented Nov 6, 2017

@bagder anything else I can do? Thanks!

@bagder bagder closed this in 32828cc Nov 9, 2017
@bagder
Copy link
Member

bagder commented Nov 9, 2017

Merged now, thanks!

@bluca bluca deleted the linux_vrf branch November 9, 2017 13:23
@bluca
Copy link
Contributor Author

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.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants