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

Supporting auto network device #11

Merged
merged 1 commit into from
May 7, 2024
Merged

Conversation

SebaLukas
Copy link
Collaborator

Describe your changes

Now the first ipv6 interface is selected if the interface name is auto. Super helpful, running in the SIL.

Issue ticket number and link

Checklist before requesting a review

  • I have performed a self-review of my code
  • I have made corresponding changes to the documentation
  • I read the contribution documentation and made sure that my changes meet its requirements

@MarzellT
Copy link
Member

I mean it's not really part of this Pull Request, but why don't we return the address in the get_first_sockaddr_in6_for_interface function instead of returning bool? This seems to me like C style instead of C++.

@a-w50
Copy link
Contributor

a-w50 commented Apr 23, 2024

I mean it's not really part of this Pull Request, but why don't we return the address in the get_first_sockaddr_in6_for_interface function instead of returning bool? This seems to me like C style instead of C++.

You can't return address directly, because if no device is found, what would you return? One could use a std::optional<address> as return value or even a std::unique_ptr<address>. It depends quite a bit but I would agree that a std::optional might be the best option here.

@MarzellT
Copy link
Member

I mean it's not really part of this Pull Request, but why don't we return the address in the get_first_sockaddr_in6_for_interface function instead of returning bool? This seems to me like C style instead of C++.

You can't return address directly, because if no device is found, what would you return? One could use a std::optional<address> as return value or even a std::unique_ptr<address>. It depends quite a bit but I would agree that a std::optional might be the best option here.

I think a std::optional or throwing an exception would be fitting but I just wanted to raise this to discuss using this style in general

@SebaLukas SebaLukas requested a review from a-w50 April 25, 2024 05:26
@SebaLukas SebaLukas force-pushed the feature/add-auto-device branch from 191ce0a to 0391a80 Compare May 2, 2024 14:12
…nterface name is auto

Signed-off-by: Sebastian Lukas <sebastian.lukas@pionix.de>
@SebaLukas SebaLukas force-pushed the feature/add-auto-device branch from ef03736 to 83040cb Compare May 7, 2024 07:50
@SebaLukas SebaLukas merged commit 38cf274 into main May 7, 2024
3 checks passed
@SebaLukas SebaLukas deleted the feature/add-auto-device branch May 7, 2024 07:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants