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

read DNS ip address from openvpn output ( fix #3 ) #5

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

FelipeLema
Copy link

fixes #3

for now, this will read the "here's a DNS ip address you should set to", but I don't know exactly what to do with it. systemd-resolved requires an interface index... which I dunno where to get it from.

@@ -165,6 +165,11 @@ pub async fn connect_ovpn(
if let Ok(ref line) = next {
if let Some(line) = line {
log.append_process(pid, line.as_str());
tokio::spawn(async move {
// Process each socket concurrently.
parse_dns(line.to_string())
Copy link

Choose a reason for hiding this comment

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

68% of developers fix this issue

compiler-message: error[E0425]: cannot find function parse_dns in this scope
--> src/cmd.rs:170:21
|
170 | parse_dns(line.to_string())
| ^^^^^^^^^ not found in this scope
|
help: consider importing this function
|
1 | use crate::dns::parse_dns;
|


ℹ️ Expand to see all @sonatype-lift commands

You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.

Command Usage
@sonatype-lift ignore Leave out the above finding from this PR
@sonatype-lift ignoreall Leave out all the existing findings from this PR
@sonatype-lift exclude <file|issue|path|tool> Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file

Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

tokio::spawn(async move {
// Process each socket concurrently.
parse_dns(line.to_string())
.and_then(|dns_address| _WIP_("Do something with this IP address"))
Copy link

Choose a reason for hiding this comment

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

68% of developers fix this issue

compiler-message: error[E0425]: cannot find function _WIP_ in this scope
--> src/cmd.rs:171:49
|
171 | .and_then(|dns_address| WIP("Do something with this IP address"))
| ^^^^^ not found in this scope


ℹ️ Expand to see all @sonatype-lift commands

You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.

Command Usage
@sonatype-lift ignore Leave out the above finding from this PR
@sonatype-lift ignoreall Leave out all the existing findings from this PR
@sonatype-lift exclude <file|issue|path|tool> Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file

Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

Copy link
Author

Choose a reason for hiding this comment

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

this is intentional: I don't know what "interface index" to give to systemd-resolved

@FelipeLema FelipeLema changed the title read DNS ip address from openvpn out ( fix #3 ) read DNS ip address from openvpn output ( fix #3 ) Apr 5, 2023
@JonathanxD
Copy link
Owner

JonathanxD commented Apr 6, 2023

Thanks for the contribution, I'll try to look into this and see if I can help.

I came across this documentation and by looking at the samples scripts I have on my machine it seems that we can use the “main interface” id¹ and append the DNS server there, in such a way that it doesn't override the current ones, but serves as a fallback, and this may be enough to resolve intranet addresses (we could also prepend, but honestly idk which one is better).

¹: About this one, we can look at /sys/class/net/ to find the index, but I'm still up to figure out how do we know which one is the main interface, I may need to do more research on this, but we can always fallback and ask NetworkManager to tell us.

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.

DNS Resolution
2 participants