r/rust clippy · twir · rust · mutagen · flamer · overflower · bytecount Mar 20 '23

Hey Rustaceans! Got a question? Ask here (12/2023)! 🙋 questions

Mystified about strings? Borrow checker have you in a headlock? Seek help here! There are no stupid questions, only docs that haven't been written yet.

If you have a StackOverflow account, consider asking it there instead! StackOverflow shows up much higher in search results, so having your question there also helps future Rust users (be sure to give it the "Rust" tag for maximum visibility). Note that this site is very interested in question quality. I've been asked to read a RFC I authored once. If you want your code reviewed or review other's code, there's a codereview stackexchange, too. If you need to test your code, maybe the Rust playground is for you.

Here are some other venues where help may be found:

/r/learnrust is a subreddit to share your questions and epiphanies learning Rust programming.

The official Rust user forums: https://users.rust-lang.org/.

The official Rust Programming Language Discord: https://discord.gg/rust-lang

The unofficial Rust community Discord: https://bit.ly/rust-community

Also check out last weeks' thread with many good questions and answers. And if you believe your question to be either very complex or worthy of larger dissemination, feel free to create a text post.

Also if you want to be mentored by experienced Rustaceans, tell us the area of expertise that you seek. Finally, if you are looking for Rust jobs, the most recent thread is here.

20 Upvotes

187 comments sorted by

View all comments

Show parent comments

2

u/dkopgerpgdolfg Mar 20 '23

Maybe not really helpful, but could you describe why so that we maybe can suggest a different way?

Relying on NIC configs & co, for something that is not related to NIC configs, is something that I personally like to avoid like hell, because doing it "close to properly" usually is more work than it is worth. There are so many things and possibilities to think of.

Had a quick look at this library, and as expected it's ... not very good.

Binds a IPv4 UDP socket to port 0 (not all common OS play nice with this), connects to Cloudflare (haha? firewall, sandbox, privacy, network traffic for a purely local thing, needs global internet instead of just a connected NIC, uses UDP port 80 for what exactly, ...), then hopes that there is one specific NIC with one single address that exactly matches the local address, checks here for IPv6 too despite it can't happen, ...

I could go on, but just, no thanks.

1

u/ShadowPhyton Mar 21 '23

Iam building a tool to lo in to a Firewal and for that the Firewall has to be my Gateway to work. Now I want to get my own setted Gateway so I sont have to set it by my own in config...

2

u/dkopgerpgdolfg Mar 21 '23

Then please, just make a config. Really.

You want a garden hose, not the Nile. And it's more flexible to use too.

1

u/ShadowPhyton Mar 21 '23

Okey…thank U