When i try to construct tun device from supplied fd in wireguard, how to get the correct interface port number in ubuntu?

I was trying to create tunnel using wireguard.
syscall.SetNonblock throws an error of "Bad file number".
May i know, how to get the interface number, which needs to passed to setNonBlock function
Screenshot from 2022-06-29 21-23-04.png
 
Ok let's see what we have here:

There's "Ubuntu" and "wireguard" mentioned, but no trace of them in the question. Of course, no trace of FreeBSD either.
Then there's a very tiny snippet of "Go" code in a picture, without any context.

This question is clearly in the wrong place here. From this code snippet, I'd assume it's about programming, so it would be wrong on some generic Ubuntu forum as well. And for a programming question, any context is missing, so nobody could answer it anyways.
 
Besides, that function looks to take a file descriptor, not an interface number.
It makes sense because "non-blocking" is an attribute that is set on FDs.

Try looking further up the call stack.
 
Back
Top